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