multiple_tables.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  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">
  7. <title>TableTools example - Multiple tables</title>
  8. <link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
  9. <link rel="stylesheet" type="text/css" href="../css/dataTables.tableTools.css">
  10. <link rel="stylesheet" type="text/css" href="../../../examples/resources/syntax/shCore.css">
  11. <link rel="stylesheet" type="text/css" href="../../../examples/resources/demo.css">
  12. <style type="text/css" class="init">
  13. </style>
  14. <script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
  15. <script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
  16. <script type="text/javascript" language="javascript" src="../js/dataTables.tableTools.js"></script>
  17. <script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
  18. <script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
  19. <script type="text/javascript" language="javascript" class="init">
  20. $(document).ready(function() {
  21. $('#example').DataTable( {
  22. dom: 'T<"clear">lfrtip'
  23. } );
  24. } );
  25. </script>
  26. </head>
  27. <body class="dt-example">
  28. <div class="container">
  29. <section>
  30. <h1>TableTools example <span>Multiple tables</span></h1>
  31. <div class="info">
  32. <p>This example shows how multiple tables can be initialised with DataTables and TableTools in a single call to the <code>$().DataTable()</code> function.
  33. Basically it works as you would expect - no special considerations need be made!</p>
  34. </div>
  35. <table id="" class="display" cellspacing="0" width="100%">
  36. <thead>
  37. <tr>
  38. <th>Name</th>
  39. <th>Position</th>
  40. <th>Office</th>
  41. <th>Age</th>
  42. <th>Salary</th>
  43. </tr>
  44. </thead>
  45. <tfoot>
  46. <tr>
  47. <th>Name</th>
  48. <th>Position</th>
  49. <th>Office</th>
  50. <th>Age</th>
  51. <th>Salary</th>
  52. </tr>
  53. </tfoot>
  54. <tbody>
  55. <tr>
  56. <td>Tiger Nixon</td>
  57. <td>System Architect</td>
  58. <td>Edinburgh</td>
  59. <td>61</td>
  60. <td>$320,800</td>
  61. </tr>
  62. <tr>
  63. <td>Cedric Kelly</td>
  64. <td>Senior Javascript Developer</td>
  65. <td>Edinburgh</td>
  66. <td>22</td>
  67. <td>$433,060</td>
  68. </tr>
  69. <tr>
  70. <td>Sonya Frost</td>
  71. <td>Software Engineer</td>
  72. <td>Edinburgh</td>
  73. <td>23</td>
  74. <td>$103,600</td>
  75. </tr>
  76. <tr>
  77. <td>Quinn Flynn</td>
  78. <td>Support Lead</td>
  79. <td>Edinburgh</td>
  80. <td>22</td>
  81. <td>$342,000</td>
  82. </tr>
  83. <tr>
  84. <td>Dai Rios</td>
  85. <td>Personnel Lead</td>
  86. <td>Edinburgh</td>
  87. <td>35</td>
  88. <td>$217,500</td>
  89. </tr>
  90. <tr>
  91. <td>Gavin Joyce</td>
  92. <td>Developer</td>
  93. <td>Edinburgh</td>
  94. <td>42</td>
  95. <td>$92,575</td>
  96. </tr>
  97. <tr>
  98. <td>Martena Mccray</td>
  99. <td>Post-Sales support</td>
  100. <td>Edinburgh</td>
  101. <td>46</td>
  102. <td>$324,050</td>
  103. </tr>
  104. <tr>
  105. <td>Jennifer Acosta</td>
  106. <td>Junior Javascript Developer</td>
  107. <td>Edinburgh</td>
  108. <td>43</td>
  109. <td>$75,650</td>
  110. </tr>
  111. <tr>
  112. <td>Shad Decker</td>
  113. <td>Regional Director</td>
  114. <td>Edinburgh</td>
  115. <td>51</td>
  116. <td>$183,000</td>
  117. </tr>
  118. </tbody>
  119. </table>
  120. <table id="" class="display" cellspacing="0" width="100%">
  121. <thead>
  122. <tr>
  123. <th>Name</th>
  124. <th>Position</th>
  125. <th>Office</th>
  126. <th>Age</th>
  127. <th>Salary</th>
  128. </tr>
  129. </thead>
  130. <tfoot>
  131. <tr>
  132. <th>Name</th>
  133. <th>Position</th>
  134. <th>Office</th>
  135. <th>Age</th>
  136. <th>Salary</th>
  137. </tr>
  138. </tfoot>
  139. <tbody>
  140. <tr>
  141. <td>Jena Gaines</td>
  142. <td>Office Manager</td>
  143. <td>London</td>
  144. <td>30</td>
  145. <td>$90,560</td>
  146. </tr>
  147. <tr>
  148. <td>Haley Kennedy</td>
  149. <td>Senior Marketing Designer</td>
  150. <td>London</td>
  151. <td>43</td>
  152. <td>$313,500</td>
  153. </tr>
  154. <tr>
  155. <td>Tatyana Fitzpatrick</td>
  156. <td>Regional Director</td>
  157. <td>London</td>
  158. <td>19</td>
  159. <td>$385,750</td>
  160. </tr>
  161. <tr>
  162. <td>Michael Silva</td>
  163. <td>Marketing Designer</td>
  164. <td>London</td>
  165. <td>66</td>
  166. <td>$198,500</td>
  167. </tr>
  168. <tr>
  169. <td>Bradley Greer</td>
  170. <td>Software Engineer</td>
  171. <td>London</td>
  172. <td>41</td>
  173. <td>$132,000</td>
  174. </tr>
  175. <tr>
  176. <td>Angelica Ramos</td>
  177. <td>Chief Executive Officer (CEO)</td>
  178. <td>London</td>
  179. <td>47</td>
  180. <td>$1,200,000</td>
  181. </tr>
  182. <tr>
  183. <td>Suki Burks</td>
  184. <td>Developer</td>
  185. <td>London</td>
  186. <td>53</td>
  187. <td>$114,500</td>
  188. </tr>
  189. <tr>
  190. <td>Prescott Bartlett</td>
  191. <td>Technical Author</td>
  192. <td>London</td>
  193. <td>27</td>
  194. <td>$145,000</td>
  195. </tr>
  196. <tr>
  197. <td>Timothy Mooney</td>
  198. <td>Office Manager</td>
  199. <td>London</td>
  200. <td>37</td>
  201. <td>$136,200</td>
  202. </tr>
  203. <tr>
  204. <td>Bruno Nash</td>
  205. <td>Software Engineer</td>
  206. <td>London</td>
  207. <td>38</td>
  208. <td>$163,500</td>
  209. </tr>
  210. <tr>
  211. <td>Hermione Butler</td>
  212. <td>Regional Director</td>
  213. <td>London</td>
  214. <td>47</td>
  215. <td>$356,250</td>
  216. </tr>
  217. <tr>
  218. <td>Lael Greer</td>
  219. <td>Systems Administrator</td>
  220. <td>London</td>
  221. <td>21</td>
  222. <td>$103,500</td>
  223. </tr>
  224. </tbody>
  225. </table>
  226. <ul class="tabs">
  227. <li class="active">Javascript</li>
  228. <li>HTML</li>
  229. <li>CSS</li>
  230. <li>Ajax</li>
  231. <li>Server-side script</li>
  232. </ul>
  233. <div class="tabs">
  234. <div class="js">
  235. <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
  236. $('#example').DataTable( {
  237. dom: 'T&lt;&quot;clear&quot;&gt;lfrtip'
  238. } );
  239. } );</code>
  240. <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
  241. <ul>
  242. <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
  243. <li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
  244. <li><a href="../js/dataTables.tableTools.js">../js/dataTables.tableTools.js</a></li>
  245. </ul>
  246. </div>
  247. <div class="table">
  248. <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
  249. </div>
  250. <div class="css">
  251. <div>
  252. <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
  253. additional CSS used is shown below:</p><code class="multiline language-css"></code>
  254. </div>
  255. <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
  256. <ul>
  257. <li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
  258. <li><a href="../css/dataTables.tableTools.css">../css/dataTables.tableTools.css</a></li>
  259. </ul>
  260. </div>
  261. <div class="ajax">
  262. <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
  263. loaded.</p>
  264. </div>
  265. <div class="php">
  266. <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
  267. processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
  268. documentation</a>.</p>
  269. </div>
  270. </div>
  271. </section>
  272. </div>
  273. <section>
  274. <div class="footer">
  275. <div class="gradient"></div>
  276. <div class="liner">
  277. <h2>Other examples</h2>
  278. <div class="toc">
  279. <div class="toc-group">
  280. <h3><a href="./index.html">Examples</a></h3>
  281. <ul class="toc active">
  282. <li><a href="./simple.html">Basic initialisation</a></li>
  283. <li><a href="./swf_path.html">Setting the SWF path</a></li>
  284. <li><a href="./new_init.html">Initialisation with `new`</a></li>
  285. <li><a href="./defaults.html">Defaults</a></li>
  286. <li><a href="./select_single.html">Row selection - single row select</a></li>
  287. <li><a href="./select_multi.html">Row selection - multi-row select</a></li>
  288. <li><a href="./select_os.html">Row selection - operating system style</a></li>
  289. <li><a href="./select_column.html">Row selection - row selector on specific cells</a></li>
  290. <li class="active"><a href="./multiple_tables.html">Multiple tables</a></li>
  291. <li><a href="./multi_instance.html">Multiple toolbars</a></li>
  292. <li><a href="./collection.html">Button collections</a></li>
  293. <li><a href="./plug-in.html">Plug-in button types</a></li>
  294. <li><a href="./button_text.html">Custom button text</a></li>
  295. <li><a href="./alter_buttons.html">Button arrangement</a></li>
  296. <li><a href="./ajax.html">Ajax loaded data</a></li>
  297. <li><a href="./pdf_message.html">PDF message</a></li>
  298. <li><a href="./bootstrap.html">Bootstrap styling</a></li>
  299. <li><a href="./jqueryui.html">jQuery UI styling</a></li>
  300. </ul>
  301. </div>
  302. </div>
  303. <div class="epilogue">
  304. <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
  305. 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>
  306. which extend the capabilities of DataTables.</p>
  307. <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &#169; 2007-2015<br>
  308. DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
  309. </div>
  310. </div>
  311. </div>
  312. </section>
  313. </body>
  314. </html>