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 - `new` constructor
</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>`new` constructor
</span></h1>
44 <p>Responsive will automatically detect new DataTable instances being created on a page and initialise itself if it find the
<a href=
45 "//datatables.net/extensions/responsive/reference/option/responsive"><code class=
"option" title=
46 "Responsive initialisation option">responsive
<span>R
</span></code></a> option or
<code>responsive
</code> class name on the table, as shown in the other
49 <p>The third way of initialising Responsive is manually creating a new instance using the
<code>$.fn.dataTable.Responsive
</code> class, as shown in this example
50 (the other two methods are provided using this constructor in a
<a href=
"//datatables.net/reference/event/init"><code class=
"event" title=
51 "DataTables event">init
<span>DT
</span></code></a> event handler!).
</p>
54 <table id=
"example" class=
"display nowrap" cellspacing=
"0" width=
"100%">
73 <td>System Architect
</td>
79 <td>t.nixon@datatables.net
</td>
90 <td>g.winters@datatables.net
</td>
95 <td>Junior Technical Author
</td>
96 <td>San Francisco
</td>
101 <td>a.cox@datatables.net
</td>
106 <td>Senior Javascript Developer
</td>
112 <td>c.kelly@datatables.net
</td>
123 <td>a.satou@datatables.net
</td>
128 <td>Integration Specialist
</td>
134 <td>b.williamson@datatables.net
</td>
139 <td>Sales Assistant
</td>
140 <td>San Francisco
</td>
145 <td>h.chandler@datatables.net
</td>
150 <td>Integration Specialist
</td>
156 <td>r.davidson@datatables.net
</td>
161 <td>Javascript Developer
</td>
162 <td>San Francisco
</td>
167 <td>c.hurst@datatables.net
</td>
172 <td>Software Engineer
</td>
178 <td>s.frost@datatables.net
</td>
183 <td>Office Manager
</td>
189 <td>j.gaines@datatables.net
</td>
194 <td>Support Lead
</td>
200 <td>q.flynn@datatables.net
</td>
205 <td>Regional Director
</td>
206 <td>San Francisco
</td>
211 <td>c.marshall@datatables.net
</td>
216 <td>Senior Marketing Designer
</td>
222 <td>h.kennedy@datatables.net
</td>
227 <td>Regional Director
</td>
233 <td>t.fitzpatrick@datatables.net
</td>
238 <td>Marketing Designer
</td>
244 <td>m.silva@datatables.net
</td>
249 <td>Chief Financial Officer (CFO)
</td>
255 <td>p.byrd@datatables.net
</td>
260 <td>Systems Administrator
</td>
266 <td>g.little@datatables.net
</td>
271 <td>Software Engineer
</td>
277 <td>b.greer@datatables.net
</td>
282 <td>Personnel Lead
</td>
288 <td>d.rios@datatables.net
</td>
293 <td>Development Lead
</td>
299 <td>j.caldwell@datatables.net
</td>
304 <td>Chief Marketing Officer (CMO)
</td>
310 <td>y.berry@datatables.net
</td>
315 <td>Pre-Sales Support
</td>
321 <td>c.vance@datatables.net
</td>
326 <td>Sales Assistant
</td>
332 <td>d.wilder@datatables.net
</td>
337 <td>Chief Executive Officer (CEO)
</td>
343 <td>a.ramos@datatables.net
</td>
354 <td>g.joyce@datatables.net
</td>
359 <td>Regional Director
</td>
365 <td>j.chang@datatables.net
</td>
370 <td>Software Engineer
</td>
371 <td>San Francisco
</td>
376 <td>b.wagner@datatables.net
</td>
381 <td>Chief Operating Officer (COO)
</td>
382 <td>San Francisco
</td>
387 <td>f.green@datatables.net
</td>
392 <td>Regional Marketing
</td>
398 <td>s.itou@datatables.net
</td>
403 <td>Integration Specialist
</td>
409 <td>m.house@datatables.net
</td>
420 <td>s.burks@datatables.net
</td>
425 <td>Technical Author
</td>
431 <td>p.bartlett@datatables.net
</td>
437 <td>San Francisco
</td>
442 <td>g.cortez@datatables.net
</td>
447 <td>Post-Sales support
</td>
453 <td>m.mccray@datatables.net
</td>
458 <td>Marketing Designer
</td>
459 <td>San Francisco
</td>
464 <td>u.butler@datatables.net
</td>
469 <td>Office Manager
</td>
470 <td>San Francisco
</td>
475 <td>h.hatfield@datatables.net
</td>
481 <td>San Francisco
</td>
486 <td>h.fuentes@datatables.net
</td>
491 <td>Financial Controller
</td>
492 <td>San Francisco
</td>
497 <td>v.harrell@datatables.net
</td>
502 <td>Office Manager
</td>
508 <td>t.mooney@datatables.net
</td>
519 <td>j.bradshaw@datatables.net
</td>
524 <td>Support Engineer
</td>
530 <td>o.liang@datatables.net
</td>
535 <td>Software Engineer
</td>
541 <td>b.nash@datatables.net
</td>
546 <td>Support Engineer
</td>
552 <td>s.yamamoto@datatables.net
</td>
563 <td>t.walton@datatables.net
</td>
568 <td>Support Engineer
</td>
569 <td>San Francisco
</td>
574 <td>f.camacho@datatables.net
</td>
579 <td>Data Coordinator
</td>
585 <td>s.baldwin@datatables.net
</td>
590 <td>Software Engineer
</td>
596 <td>z.frank@datatables.net
</td>
601 <td>Software Engineer
</td>
602 <td>San Francisco
</td>
607 <td>z.serrano@datatables.net
</td>
612 <td>Junior Javascript Developer
</td>
618 <td>j.acosta@datatables.net
</td>
623 <td>Sales Assistant
</td>
629 <td>c.stevens@datatables.net
</td>
634 <td>Regional Director
</td>
640 <td>h.butler@datatables.net
</td>
645 <td>Systems Administrator
</td>
651 <td>l.greer@datatables.net
</td>
657 <td>San Francisco
</td>
662 <td>j.alexander@datatables.net
</td>
667 <td>Regional Director
</td>
673 <td>s.decker@datatables.net
</td>
678 <td>Javascript Developer
</td>
684 <td>m.bruce@datatables.net
</td>
689 <td>Customer Support
</td>
695 <td>d.snider@datatables.net
</td>
701 <li class=
"active">Javascript
</li>
705 <li>Server-side script
</li>
710 <p>The Javascript shown below is used to initialise the table shown in this example:
</p><code class=
"multiline language-js">$(document).ready(function() {
711 var table = $('#example').DataTable();
713 new $.fn.dataTable.Responsive( table );
716 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:
</p>
719 <li><a href=
"../../../../media/js/jquery.js">../../../../media/js/jquery.js
</a></li>
720 <li><a href=
"../../../../media/js/jquery.dataTables.js">../../../../media/js/jquery.dataTables.js
</a></li>
721 <li><a href=
"../../js/dataTables.responsive.js">../../js/dataTables.responsive.js
</a></li>
726 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:
</p>
731 <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
732 additional CSS used is shown below:
</p><code class=
"multiline language-css">div.container { max-width:
1200px }
</code>
735 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:
</p>
738 <li><a href=
"../../../../media/css/jquery.dataTables.css">../../../../media/css/jquery.dataTables.css
</a></li>
739 <li><a href=
"../../css/dataTables.responsive.css">../../css/dataTables.responsive.css
</a></li>
744 <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
749 <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
750 processing scripts can be written in any language, using
<a href=
"//datatables.net/manual/server-side">the protocol described in the DataTables
751 documentation
</a>.
</p>
759 <div class=
"gradient"></div>
762 <h2>Other examples
</h2>
765 <div class=
"toc-group">
766 <h3><a href=
"./index.html">Basic initialisation
</a></h3>
767 <ul class=
"toc active">
768 <li><a href=
"./className.html">Class name
</a></li>
769 <li><a href=
"./option.html">Configuration option
</a></li>
770 <li class=
"active"><a href=
"./new.html">`new` constructor
</a></li>
771 <li><a href=
"./ajax.html">Ajax data
</a></li>
772 <li><a href=
"./default.html">Default initialisation
</a></li>
776 <div class=
"toc-group">
777 <h3><a href=
"../styling/index.html">Styling
</a></h3>
779 <li><a href=
"../styling/bootstrap.html">Bootstrap styling
</a></li>
780 <li><a href=
"../styling/foundation.html">Foundation styling
</a></li>
781 <li><a href=
"../styling/scrolling.html">Vertical scrolling
</a></li>
782 <li><a href=
"../styling/compact.html">Compact styling
</a></li>
786 <div class=
"toc-group">
787 <h3><a href=
"../display-control/index.html">Display control
</a></h3>
789 <li><a href=
"../display-control/auto.html">Automatic column hiding
</a></li>
790 <li><a href=
"../display-control/classes.html">Class control
</a></li>
791 <li><a href=
"../display-control/init-classes.html">Assigned class control
</a></li>
792 <li><a href=
"../display-control/fixedHeader.html">With FixedHeader
</a></li>
793 <li><a href=
"../display-control/complexHeader.html">Complex headers (rowspan / colspan)
</a></li>
797 <div class=
"toc-group">
798 <h3><a href=
"../child-rows/index.html">Child rows
</a></h3>
800 <li><a href=
"../child-rows/disable-child-rows.html">Disable child rows
</a></li>
801 <li><a href=
"../child-rows/column-control.html">Column controlled child rows
</a></li>
802 <li><a href=
"../child-rows/right-column.html">Column control - right
</a></li>
803 <li><a href=
"../child-rows/whole-row-control.html">Whole row child row control
</a></li>
804 <li><a href=
"../child-rows/custom-renderer.html">Custom child row renderer
</a></li>
809 <div class=
"epilogue">
810 <p>Please refer to the
<a href=
"http://www.datatables.net">DataTables documentation
</a> for full information about its API properties and methods.
<br>
811 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>
812 which extend the capabilities of DataTables.
</p>
814 <p class=
"copyright">DataTables designed and created by
<a href=
"http://www.sprymedia.co.uk">SpryMedia Ltd
</a> © 2007-
2015<br>
815 DataTables is licensed under the
<a href=
"http://www.datatables.net/mit">MIT license
</a>.
</p>