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 - Class name
</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">
16 <script type=
"text/javascript" language=
"javascript" src=
"../../../../media/js/jquery.js"></script>
17 <script type=
"text/javascript" language=
"javascript" src=
"../../../../media/js/jquery.dataTables.js"></script>
18 <script type=
"text/javascript" language=
"javascript" src=
"../../js/dataTables.responsive.js"></script>
19 <script type=
"text/javascript" language=
"javascript" src=
"../../../../examples/resources/syntax/shCore.js"></script>
20 <script type=
"text/javascript" language=
"javascript" src=
"../../../../examples/resources/demo.js"></script>
21 <script type=
"text/javascript" language=
"javascript" class=
"init">
25 $(document).ready(function() {
26 $('#example').DataTable();
34 <body class=
"dt-example">
35 <div class=
"container">
37 <h1>Responsive example
<span>Class name
</span></h1>
40 <p>The easiest way to initialise the Responsive extension for DataTables is simply to add the class
<code class=
"string" title=
"String">responsive
</code> to the
41 table's class name. When the DataTable is initialised the Responsive extension will automatically enable itself on these tables.
</p>
43 <p>The may also use the class
<code>dt-responsive
</code> to perform the same action, since
<code>responsive
</code> may be used in your stylesheet, or may have some
44 other meaning in a CSS framework being used (for example Bootstrap).
</p>
47 <table id=
"example" class=
"display responsive nowrap" cellspacing=
"0" width=
"100%">
66 <td>System Architect
</td>
72 <td>t.nixon@datatables.net
</td>
83 <td>g.winters@datatables.net
</td>
88 <td>Junior Technical Author
</td>
89 <td>San Francisco
</td>
94 <td>a.cox@datatables.net
</td>
99 <td>Senior Javascript Developer
</td>
105 <td>c.kelly@datatables.net
</td>
116 <td>a.satou@datatables.net
</td>
121 <td>Integration Specialist
</td>
127 <td>b.williamson@datatables.net
</td>
132 <td>Sales Assistant
</td>
133 <td>San Francisco
</td>
138 <td>h.chandler@datatables.net
</td>
143 <td>Integration Specialist
</td>
149 <td>r.davidson@datatables.net
</td>
154 <td>Javascript Developer
</td>
155 <td>San Francisco
</td>
160 <td>c.hurst@datatables.net
</td>
165 <td>Software Engineer
</td>
171 <td>s.frost@datatables.net
</td>
176 <td>Office Manager
</td>
182 <td>j.gaines@datatables.net
</td>
187 <td>Support Lead
</td>
193 <td>q.flynn@datatables.net
</td>
198 <td>Regional Director
</td>
199 <td>San Francisco
</td>
204 <td>c.marshall@datatables.net
</td>
209 <td>Senior Marketing Designer
</td>
215 <td>h.kennedy@datatables.net
</td>
220 <td>Regional Director
</td>
226 <td>t.fitzpatrick@datatables.net
</td>
231 <td>Marketing Designer
</td>
237 <td>m.silva@datatables.net
</td>
242 <td>Chief Financial Officer (CFO)
</td>
248 <td>p.byrd@datatables.net
</td>
253 <td>Systems Administrator
</td>
259 <td>g.little@datatables.net
</td>
264 <td>Software Engineer
</td>
270 <td>b.greer@datatables.net
</td>
275 <td>Personnel Lead
</td>
281 <td>d.rios@datatables.net
</td>
286 <td>Development Lead
</td>
292 <td>j.caldwell@datatables.net
</td>
297 <td>Chief Marketing Officer (CMO)
</td>
303 <td>y.berry@datatables.net
</td>
308 <td>Pre-Sales Support
</td>
314 <td>c.vance@datatables.net
</td>
319 <td>Sales Assistant
</td>
325 <td>d.wilder@datatables.net
</td>
330 <td>Chief Executive Officer (CEO)
</td>
336 <td>a.ramos@datatables.net
</td>
347 <td>g.joyce@datatables.net
</td>
352 <td>Regional Director
</td>
358 <td>j.chang@datatables.net
</td>
363 <td>Software Engineer
</td>
364 <td>San Francisco
</td>
369 <td>b.wagner@datatables.net
</td>
374 <td>Chief Operating Officer (COO)
</td>
375 <td>San Francisco
</td>
380 <td>f.green@datatables.net
</td>
385 <td>Regional Marketing
</td>
391 <td>s.itou@datatables.net
</td>
396 <td>Integration Specialist
</td>
402 <td>m.house@datatables.net
</td>
413 <td>s.burks@datatables.net
</td>
418 <td>Technical Author
</td>
424 <td>p.bartlett@datatables.net
</td>
430 <td>San Francisco
</td>
435 <td>g.cortez@datatables.net
</td>
440 <td>Post-Sales support
</td>
446 <td>m.mccray@datatables.net
</td>
451 <td>Marketing Designer
</td>
452 <td>San Francisco
</td>
457 <td>u.butler@datatables.net
</td>
462 <td>Office Manager
</td>
463 <td>San Francisco
</td>
468 <td>h.hatfield@datatables.net
</td>
474 <td>San Francisco
</td>
479 <td>h.fuentes@datatables.net
</td>
484 <td>Financial Controller
</td>
485 <td>San Francisco
</td>
490 <td>v.harrell@datatables.net
</td>
495 <td>Office Manager
</td>
501 <td>t.mooney@datatables.net
</td>
512 <td>j.bradshaw@datatables.net
</td>
517 <td>Support Engineer
</td>
523 <td>o.liang@datatables.net
</td>
528 <td>Software Engineer
</td>
534 <td>b.nash@datatables.net
</td>
539 <td>Support Engineer
</td>
545 <td>s.yamamoto@datatables.net
</td>
556 <td>t.walton@datatables.net
</td>
561 <td>Support Engineer
</td>
562 <td>San Francisco
</td>
567 <td>f.camacho@datatables.net
</td>
572 <td>Data Coordinator
</td>
578 <td>s.baldwin@datatables.net
</td>
583 <td>Software Engineer
</td>
589 <td>z.frank@datatables.net
</td>
594 <td>Software Engineer
</td>
595 <td>San Francisco
</td>
600 <td>z.serrano@datatables.net
</td>
605 <td>Junior Javascript Developer
</td>
611 <td>j.acosta@datatables.net
</td>
616 <td>Sales Assistant
</td>
622 <td>c.stevens@datatables.net
</td>
627 <td>Regional Director
</td>
633 <td>h.butler@datatables.net
</td>
638 <td>Systems Administrator
</td>
644 <td>l.greer@datatables.net
</td>
650 <td>San Francisco
</td>
655 <td>j.alexander@datatables.net
</td>
660 <td>Regional Director
</td>
666 <td>s.decker@datatables.net
</td>
671 <td>Javascript Developer
</td>
677 <td>m.bruce@datatables.net
</td>
682 <td>Customer Support
</td>
688 <td>d.snider@datatables.net
</td>
694 <li class=
"active">Javascript
</li>
698 <li>Server-side script
</li>
703 <p>The Javascript shown below is used to initialise the table shown in this example:
</p><code class=
"multiline language-js">$(document).ready(function() {
704 $('#example').DataTable();
707 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:
</p>
710 <li><a href=
"../../../../media/js/jquery.js">../../../../media/js/jquery.js
</a></li>
711 <li><a href=
"../../../../media/js/jquery.dataTables.js">../../../../media/js/jquery.dataTables.js
</a></li>
712 <li><a href=
"../../js/dataTables.responsive.js">../../js/dataTables.responsive.js
</a></li>
717 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:
</p>
722 <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
723 additional CSS used is shown below:
</p><code class=
"multiline language-css"></code>
726 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:
</p>
729 <li><a href=
"../../../../media/css/jquery.dataTables.css">../../../../media/css/jquery.dataTables.css
</a></li>
730 <li><a href=
"../../css/dataTables.responsive.css">../../css/dataTables.responsive.css
</a></li>
735 <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
740 <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
741 processing scripts can be written in any language, using
<a href=
"//datatables.net/manual/server-side">the protocol described in the DataTables
742 documentation
</a>.
</p>
750 <div class=
"gradient"></div>
753 <h2>Other examples
</h2>
756 <div class=
"toc-group">
757 <h3><a href=
"./index.html">Basic initialisation
</a></h3>
758 <ul class=
"toc active">
759 <li class=
"active"><a href=
"./className.html">Class name
</a></li>
760 <li><a href=
"./option.html">Configuration option
</a></li>
761 <li><a href=
"./new.html">`new` constructor
</a></li>
762 <li><a href=
"./ajax.html">Ajax data
</a></li>
763 <li><a href=
"./default.html">Default initialisation
</a></li>
767 <div class=
"toc-group">
768 <h3><a href=
"../styling/index.html">Styling
</a></h3>
770 <li><a href=
"../styling/bootstrap.html">Bootstrap styling
</a></li>
771 <li><a href=
"../styling/foundation.html">Foundation styling
</a></li>
772 <li><a href=
"../styling/scrolling.html">Vertical scrolling
</a></li>
773 <li><a href=
"../styling/compact.html">Compact styling
</a></li>
777 <div class=
"toc-group">
778 <h3><a href=
"../display-control/index.html">Display control
</a></h3>
780 <li><a href=
"../display-control/auto.html">Automatic column hiding
</a></li>
781 <li><a href=
"../display-control/classes.html">Class control
</a></li>
782 <li><a href=
"../display-control/init-classes.html">Assigned class control
</a></li>
783 <li><a href=
"../display-control/fixedHeader.html">With FixedHeader
</a></li>
784 <li><a href=
"../display-control/complexHeader.html">Complex headers (rowspan / colspan)
</a></li>
788 <div class=
"toc-group">
789 <h3><a href=
"../child-rows/index.html">Child rows
</a></h3>
791 <li><a href=
"../child-rows/disable-child-rows.html">Disable child rows
</a></li>
792 <li><a href=
"../child-rows/column-control.html">Column controlled child rows
</a></li>
793 <li><a href=
"../child-rows/right-column.html">Column control - right
</a></li>
794 <li><a href=
"../child-rows/whole-row-control.html">Whole row child row control
</a></li>
795 <li><a href=
"../child-rows/custom-renderer.html">Custom child row renderer
</a></li>
800 <div class=
"epilogue">
801 <p>Please refer to the
<a href=
"http://www.datatables.net">DataTables documentation
</a> for full information about its API properties and methods.
<br>
802 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>
803 which extend the capabilities of DataTables.
</p>
805 <p class=
"copyright">DataTables designed and created by
<a href=
"http://www.sprymedia.co.uk">SpryMedia Ltd
</a> © 2007-
2015<br>
806 DataTables is licensed under the
<a href=
"http://www.datatables.net/mit">MIT license
</a>.
</p>