5 <link rel=
"shortcut icon" type=
"image/ico" href=
"http://www.datatables.net/favicon.ico">
6 <meta name=
"viewport" content=
"initial-scale=1.0, maximum-scale=2.0">
8 <title>Responsive example - Compact styling
</title>
9 <link rel=
"stylesheet" type=
"text/css" href=
"../../../../media/css/jquery.dataTables.css">
10 <link rel=
"stylesheet" type=
"text/css" href=
"../../css/dataTables.responsive.css">
11 <link rel=
"stylesheet" type=
"text/css" href=
"../../../../examples/resources/syntax/shCore.css">
12 <link rel=
"stylesheet" type=
"text/css" href=
"../../../../examples/resources/demo.css">
13 <style type=
"text/css" class=
"init">
15 div.container { max-width:
1200px }
18 <script type=
"text/javascript" language=
"javascript" src=
"../../../../media/js/jquery.js"></script>
19 <script type=
"text/javascript" language=
"javascript" src=
"../../../../media/js/jquery.dataTables.js"></script>
20 <script type=
"text/javascript" language=
"javascript" src=
"../../js/dataTables.responsive.js"></script>
21 <script type=
"text/javascript" language=
"javascript" src=
"../../../../examples/resources/syntax/shCore.js"></script>
22 <script type=
"text/javascript" language=
"javascript" src=
"../../../../examples/resources/demo.js"></script>
23 <script type=
"text/javascript" language=
"javascript" class=
"init">
27 $(document).ready(function() {
28 var table = $('#example').DataTable();
30 new $.fn.dataTable.Responsive( table );
38 <body class=
"dt-example">
39 <div class=
"container">
41 <h1>Responsive example
<span>Compact styling
</span></h1>
44 <p>DataTables'
<a href=
"http://datatables.net/manual/styling/classes">default stylesheet
</a> has a number number of features available that can be enabled by
45 including a class name on the DataTable. One of those options is
<code>compact
</code> which displays the DataTable with less whitespace padding that might other be
46 used to increase the information density of the table. Responsive's own style has support for this
<code>compact
</code> styling as showing in this example.
</p>
49 <table id=
"example" class=
"display compact nowrap" cellspacing=
"0" width=
"100%">
68 <td>System Architect
</td>
74 <td>t.nixon@datatables.net
</td>
85 <td>g.winters@datatables.net
</td>
90 <td>Junior Technical Author
</td>
91 <td>San Francisco
</td>
96 <td>a.cox@datatables.net
</td>
101 <td>Senior Javascript Developer
</td>
107 <td>c.kelly@datatables.net
</td>
118 <td>a.satou@datatables.net
</td>
123 <td>Integration Specialist
</td>
129 <td>b.williamson@datatables.net
</td>
134 <td>Sales Assistant
</td>
135 <td>San Francisco
</td>
140 <td>h.chandler@datatables.net
</td>
145 <td>Integration Specialist
</td>
151 <td>r.davidson@datatables.net
</td>
156 <td>Javascript Developer
</td>
157 <td>San Francisco
</td>
162 <td>c.hurst@datatables.net
</td>
167 <td>Software Engineer
</td>
173 <td>s.frost@datatables.net
</td>
178 <td>Office Manager
</td>
184 <td>j.gaines@datatables.net
</td>
189 <td>Support Lead
</td>
195 <td>q.flynn@datatables.net
</td>
200 <td>Regional Director
</td>
201 <td>San Francisco
</td>
206 <td>c.marshall@datatables.net
</td>
211 <td>Senior Marketing Designer
</td>
217 <td>h.kennedy@datatables.net
</td>
222 <td>Regional Director
</td>
228 <td>t.fitzpatrick@datatables.net
</td>
233 <td>Marketing Designer
</td>
239 <td>m.silva@datatables.net
</td>
244 <td>Chief Financial Officer (CFO)
</td>
250 <td>p.byrd@datatables.net
</td>
255 <td>Systems Administrator
</td>
261 <td>g.little@datatables.net
</td>
266 <td>Software Engineer
</td>
272 <td>b.greer@datatables.net
</td>
277 <td>Personnel Lead
</td>
283 <td>d.rios@datatables.net
</td>
288 <td>Development Lead
</td>
294 <td>j.caldwell@datatables.net
</td>
299 <td>Chief Marketing Officer (CMO)
</td>
305 <td>y.berry@datatables.net
</td>
310 <td>Pre-Sales Support
</td>
316 <td>c.vance@datatables.net
</td>
321 <td>Sales Assistant
</td>
327 <td>d.wilder@datatables.net
</td>
332 <td>Chief Executive Officer (CEO)
</td>
338 <td>a.ramos@datatables.net
</td>
349 <td>g.joyce@datatables.net
</td>
354 <td>Regional Director
</td>
360 <td>j.chang@datatables.net
</td>
365 <td>Software Engineer
</td>
366 <td>San Francisco
</td>
371 <td>b.wagner@datatables.net
</td>
376 <td>Chief Operating Officer (COO)
</td>
377 <td>San Francisco
</td>
382 <td>f.green@datatables.net
</td>
387 <td>Regional Marketing
</td>
393 <td>s.itou@datatables.net
</td>
398 <td>Integration Specialist
</td>
404 <td>m.house@datatables.net
</td>
415 <td>s.burks@datatables.net
</td>
420 <td>Technical Author
</td>
426 <td>p.bartlett@datatables.net
</td>
432 <td>San Francisco
</td>
437 <td>g.cortez@datatables.net
</td>
442 <td>Post-Sales support
</td>
448 <td>m.mccray@datatables.net
</td>
453 <td>Marketing Designer
</td>
454 <td>San Francisco
</td>
459 <td>u.butler@datatables.net
</td>
464 <td>Office Manager
</td>
465 <td>San Francisco
</td>
470 <td>h.hatfield@datatables.net
</td>
476 <td>San Francisco
</td>
481 <td>h.fuentes@datatables.net
</td>
486 <td>Financial Controller
</td>
487 <td>San Francisco
</td>
492 <td>v.harrell@datatables.net
</td>
497 <td>Office Manager
</td>
503 <td>t.mooney@datatables.net
</td>
514 <td>j.bradshaw@datatables.net
</td>
519 <td>Support Engineer
</td>
525 <td>o.liang@datatables.net
</td>
530 <td>Software Engineer
</td>
536 <td>b.nash@datatables.net
</td>
541 <td>Support Engineer
</td>
547 <td>s.yamamoto@datatables.net
</td>
558 <td>t.walton@datatables.net
</td>
563 <td>Support Engineer
</td>
564 <td>San Francisco
</td>
569 <td>f.camacho@datatables.net
</td>
574 <td>Data Coordinator
</td>
580 <td>s.baldwin@datatables.net
</td>
585 <td>Software Engineer
</td>
591 <td>z.frank@datatables.net
</td>
596 <td>Software Engineer
</td>
597 <td>San Francisco
</td>
602 <td>z.serrano@datatables.net
</td>
607 <td>Junior Javascript Developer
</td>
613 <td>j.acosta@datatables.net
</td>
618 <td>Sales Assistant
</td>
624 <td>c.stevens@datatables.net
</td>
629 <td>Regional Director
</td>
635 <td>h.butler@datatables.net
</td>
640 <td>Systems Administrator
</td>
646 <td>l.greer@datatables.net
</td>
652 <td>San Francisco
</td>
657 <td>j.alexander@datatables.net
</td>
662 <td>Regional Director
</td>
668 <td>s.decker@datatables.net
</td>
673 <td>Javascript Developer
</td>
679 <td>m.bruce@datatables.net
</td>
684 <td>Customer Support
</td>
690 <td>d.snider@datatables.net
</td>
696 <li class=
"active">Javascript
</li>
700 <li>Server-side script
</li>
705 <p>The Javascript shown below is used to initialise the table shown in this example:
</p><code class=
"multiline language-js">$(document).ready(function() {
706 var table = $('#example').DataTable();
708 new $.fn.dataTable.Responsive( table );
711 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:
</p>
714 <li><a href=
"../../../../media/js/jquery.js">../../../../media/js/jquery.js
</a></li>
715 <li><a href=
"../../../../media/js/jquery.dataTables.js">../../../../media/js/jquery.dataTables.js
</a></li>
716 <li><a href=
"../../js/dataTables.responsive.js">../../js/dataTables.responsive.js
</a></li>
721 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:
</p>
726 <p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
727 additional CSS used is shown below:
</p><code class=
"multiline language-css">div.container { max-width:
1200px }
</code>
730 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:
</p>
733 <li><a href=
"../../../../media/css/jquery.dataTables.css">../../../../media/css/jquery.dataTables.css
</a></li>
734 <li><a href=
"../../css/dataTables.responsive.css">../../css/dataTables.responsive.css
</a></li>
739 <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
744 <p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
745 processing scripts can be written in any language, using
<a href=
"//datatables.net/manual/server-side">the protocol described in the DataTables
746 documentation
</a>.
</p>
754 <div class=
"gradient"></div>
757 <h2>Other examples
</h2>
760 <div class=
"toc-group">
761 <h3><a href=
"../initialisation/index.html">Basic initialisation
</a></h3>
763 <li><a href=
"../initialisation/className.html">Class name
</a></li>
764 <li><a href=
"../initialisation/option.html">Configuration option
</a></li>
765 <li><a href=
"../initialisation/new.html">`new` constructor
</a></li>
766 <li><a href=
"../initialisation/ajax.html">Ajax data
</a></li>
767 <li><a href=
"../initialisation/default.html">Default initialisation
</a></li>
771 <div class=
"toc-group">
772 <h3><a href=
"./index.html">Styling
</a></h3>
773 <ul class=
"toc active">
774 <li><a href=
"./bootstrap.html">Bootstrap styling
</a></li>
775 <li><a href=
"./foundation.html">Foundation styling
</a></li>
776 <li><a href=
"./scrolling.html">Vertical scrolling
</a></li>
777 <li class=
"active"><a href=
"./compact.html">Compact styling
</a></li>
781 <div class=
"toc-group">
782 <h3><a href=
"../display-control/index.html">Display control
</a></h3>
784 <li><a href=
"../display-control/auto.html">Automatic column hiding
</a></li>
785 <li><a href=
"../display-control/classes.html">Class control
</a></li>
786 <li><a href=
"../display-control/init-classes.html">Assigned class control
</a></li>
787 <li><a href=
"../display-control/fixedHeader.html">With FixedHeader
</a></li>
788 <li><a href=
"../display-control/complexHeader.html">Complex headers (rowspan / colspan)
</a></li>
792 <div class=
"toc-group">
793 <h3><a href=
"../child-rows/index.html">Child rows
</a></h3>
795 <li><a href=
"../child-rows/disable-child-rows.html">Disable child rows
</a></li>
796 <li><a href=
"../child-rows/column-control.html">Column controlled child rows
</a></li>
797 <li><a href=
"../child-rows/right-column.html">Column control - right
</a></li>
798 <li><a href=
"../child-rows/whole-row-control.html">Whole row child row control
</a></li>
799 <li><a href=
"../child-rows/custom-renderer.html">Custom child row renderer
</a></li>
804 <div class=
"epilogue">
805 <p>Please refer to the
<a href=
"http://www.datatables.net">DataTables documentation
</a> for full information about its API properties and methods.
<br>
806 Additionally, there are a wide range of
<a href=
"http://www.datatables.net/extras">extras
</a> and
<a href=
"http://www.datatables.net/plug-ins">plug-ins
</a>
807 which extend the capabilities of DataTables.
</p>
809 <p class=
"copyright">DataTables designed and created by
<a href=
"http://www.sprymedia.co.uk">SpryMedia Ltd
</a> © 2007-
2015<br>
810 DataTables is licensed under the
<a href=
"http://www.datatables.net/mit">MIT license
</a>.
</p>