0
|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
2 <html>
|
|
3 <head>
|
|
4 <meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
5 <link rel="shortcut icon" type="image/ico" href="http://www.sprymedia.co.uk/media/images/favicon.ico">
|
|
6
|
|
7 <title>TableTools example</title>
|
|
8 <style type="text/css" title="currentStyle">
|
|
9 @import "../../media/css/demo_page.css";
|
|
10 @import "../../media/css/demo_table.css";
|
|
11 @import "media/css/TableTools.css";
|
|
12 </style>
|
|
13 <script type="text/javascript" charset="utf-8" src="../../media/js/jquery.js"></script>
|
|
14 <script type="text/javascript" charset="utf-8" src="../../media/js/jquery.dataTables.js"></script>
|
|
15 <script type="text/javascript" charset="utf-8" src="media/js/ZeroClipboard.js"></script>
|
|
16 <script type="text/javascript" charset="utf-8" src="media/js/TableTools.js"></script>
|
|
17 <script type="text/javascript" charset="utf-8">
|
|
18 $(document).ready( function () {
|
|
19 TableTools.DEFAULTS.aButtons = [ "copy", "csv", "xls" ];
|
|
20
|
|
21 $('#example').dataTable( {
|
|
22 "sDom": 'T<"clear">lfrtip'
|
|
23 } );
|
|
24 } );
|
|
25 </script>
|
|
26 </head>
|
|
27 <body id="dt_example">
|
|
28 <div id="container">
|
|
29 <div class="full_width big">
|
|
30 TableTools example - changing the initialisation defaults
|
|
31 </div>
|
|
32
|
|
33 <h1>Preamble</h1>
|
|
34 <p>TableTools provides the ability to override the default initialisation parameters that are used when creating a new instance. This this particularly useful if you have multiple tables which you want to have the same TableTools behaviour - rather than declaring the structure multiple times, you can just set the defaults once. This example shows how to alter the default buttons.</p>
|
|
35
|
|
36
|
|
37 <h1>Live example</h1>
|
|
38 <div id="demo">
|
|
39 <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
|
|
40 <thead>
|
|
41 <tr>
|
|
42 <th>Rendering engine</th>
|
|
43 <th>Browser</th>
|
|
44 <th>Platform(s)</th>
|
|
45 <th>Engine version</th>
|
|
46 <th>CSS grade</th>
|
|
47 </tr>
|
|
48 </thead>
|
|
49 <tfoot>
|
|
50 <tr>
|
|
51 <th>Rendering engine</th>
|
|
52 <th>Browser</th>
|
|
53 <th>Platform(s)</th>
|
|
54 <th>Engine version</th>
|
|
55 <th>CSS grade</th>
|
|
56 </tr>
|
|
57 </tfoot>
|
|
58 <tbody>
|
|
59 <tr class="odd_gradeX">
|
|
60 <td>Trident</td>
|
|
61 <td>Internet Explorer 4.0</td>
|
|
62 <td>Win 95+ (Entity: &)</td>
|
|
63 <td class="center">4</td>
|
|
64 <td class="center">X</td>
|
|
65 </tr>
|
|
66 <tr class="even_gradeC">
|
|
67 <td>Trident</td>
|
|
68 <td>Internet Explorer 5.0</td>
|
|
69 <td>Win 95+</td>
|
|
70 <td class="center">5</td>
|
|
71 <td class="center">C</td>
|
|
72 </tr>
|
|
73 <tr class="odd_gradeA">
|
|
74 <td>Trident</td>
|
|
75 <td>Internet Explorer 5.5</td>
|
|
76 <td>Win 95+</td>
|
|
77 <td class="center">5.5</td>
|
|
78 <td class="center">A</td>
|
|
79 </tr>
|
|
80 <tr class="even_gradeA">
|
|
81 <td>Trident</td>
|
|
82 <td>Internet Explorer 6</td>
|
|
83 <td>Win 98+</td>
|
|
84 <td class="center">6</td>
|
|
85 <td class="center">A</td>
|
|
86 </tr>
|
|
87 <tr class="odd_gradeA">
|
|
88 <td>Trident</td>
|
|
89 <td>Internet Explorer 7</td>
|
|
90 <td>Win XP SP2+</td>
|
|
91 <td class="center">7</td>
|
|
92 <td class="center">A</td>
|
|
93 </tr>
|
|
94 <tr class="even_gradeA">
|
|
95 <td>Trident</td>
|
|
96 <td>AOL browser (AOL desktop)</td>
|
|
97 <td>Win XP</td>
|
|
98 <td class="center">6</td>
|
|
99 <td class="center">A</td>
|
|
100 </tr>
|
|
101 <tr class="odd_gradeA">
|
|
102 <td>Gecko (UTF-8: $¢€)</td>
|
|
103 <td>Firefox 1.0</td>
|
|
104 <td>Win 98+ / OSX.2+</td>
|
|
105 <td class="center">1.7</td>
|
|
106 <td class="center">A</td>
|
|
107 </tr>
|
|
108 <tr class="even_gradeA">
|
|
109 <td>Gecko</td>
|
|
110 <td>Firefox 1.5</td>
|
|
111 <td>Win 98+ / OSX.2+</td>
|
|
112 <td class="center">1.8</td>
|
|
113 <td class="center">A</td>
|
|
114 </tr>
|
|
115 <tr class="odd_gradeA">
|
|
116 <td>Gecko</td>
|
|
117 <td>Firefox 2.0</td>
|
|
118 <td>Win 98+ / OSX.2+</td>
|
|
119 <td class="center">1.8</td>
|
|
120 <td class="center">A</td>
|
|
121 </tr>
|
|
122 <tr class="even_gradeA">
|
|
123 <td>Gecko</td>
|
|
124 <td>Firefox 3.0</td>
|
|
125 <td>Win 2k+ / OSX.3+</td>
|
|
126 <td class="center">1.9</td>
|
|
127 <td class="center">A</td>
|
|
128 </tr>
|
|
129 <tr class="odd_gradeA">
|
|
130 <td>Gecko</td>
|
|
131 <td>Camino 1.0</td>
|
|
132 <td>OSX.2+</td>
|
|
133 <td class="center">1.8</td>
|
|
134 <td class="center">A</td>
|
|
135 </tr>
|
|
136 <tr class="even_gradeA">
|
|
137 <td>Gecko</td>
|
|
138 <td>Camino 1.5</td>
|
|
139 <td>OSX.3+</td>
|
|
140 <td class="center">1.8</td>
|
|
141 <td class="center">A</td>
|
|
142 </tr>
|
|
143 <tr class="odd_gradeA">
|
|
144 <td>Gecko</td>
|
|
145 <td>Netscape 7.2</td>
|
|
146 <td>Win 95+ / Mac OS 8.6-9.2</td>
|
|
147 <td class="center">1.7</td>
|
|
148 <td class="center">A</td>
|
|
149 </tr>
|
|
150 <tr class="even_gradeA">
|
|
151 <td>Gecko</td>
|
|
152 <td>Netscape Browser 8</td>
|
|
153 <td>Win 98SE+</td>
|
|
154 <td class="center">1.7</td>
|
|
155 <td class="center">A</td>
|
|
156 </tr>
|
|
157 <tr class="odd_gradeA">
|
|
158 <td>Gecko</td>
|
|
159 <td>Netscape Navigator 9</td>
|
|
160 <td>Win 98+ / OSX.2+</td>
|
|
161 <td class="center">1.8</td>
|
|
162 <td class="center">A</td>
|
|
163 </tr>
|
|
164 <tr class="even_gradeA">
|
|
165 <td>Gecko</td>
|
|
166 <td>Mozilla 1.0</td>
|
|
167 <td>Win 95+ / OSX.1+</td>
|
|
168 <td class="center">1</td>
|
|
169 <td class="center">A</td>
|
|
170 </tr>
|
|
171 <tr class="odd_gradeA">
|
|
172 <td>Gecko</td>
|
|
173 <td>Mozilla 1.1</td>
|
|
174 <td>Win 95+ / OSX.1+</td>
|
|
175 <td class="center">1.1</td>
|
|
176 <td class="center">A</td>
|
|
177 </tr>
|
|
178 <tr class="even_gradeA">
|
|
179 <td>Gecko</td>
|
|
180 <td>Mozilla 1.2</td>
|
|
181 <td>Win 95+ / OSX.1+</td>
|
|
182 <td class="center">1.2</td>
|
|
183 <td class="center">A</td>
|
|
184 </tr>
|
|
185 <tr class="odd_gradeA">
|
|
186 <td>Gecko</td>
|
|
187 <td>Mozilla 1.3</td>
|
|
188 <td>Win 95+ / OSX.1+</td>
|
|
189 <td class="center">1.3</td>
|
|
190 <td class="center">A</td>
|
|
191 </tr>
|
|
192 <tr class="even_gradeA">
|
|
193 <td>Gecko</td>
|
|
194 <td>Mozilla 1.4</td>
|
|
195 <td>Win 95+ / OSX.1+</td>
|
|
196 <td class="center">1.4</td>
|
|
197 <td class="center">A</td>
|
|
198 </tr>
|
|
199 <tr class="odd_gradeA">
|
|
200 <td>Gecko</td>
|
|
201 <td>Mozilla 1.5</td>
|
|
202 <td>Win 95+ / OSX.1+</td>
|
|
203 <td class="center">1.5</td>
|
|
204 <td class="center">A</td>
|
|
205 </tr>
|
|
206 <tr class="even_gradeA">
|
|
207 <td>Gecko</td>
|
|
208 <td>Mozilla 1.6</td>
|
|
209 <td>Win 95+ / OSX.1+</td>
|
|
210 <td class="center">1.6</td>
|
|
211 <td class="center">A</td>
|
|
212 </tr>
|
|
213 <tr class="odd_gradeA">
|
|
214 <td>Gecko</td>
|
|
215 <td>Mozilla 1.7</td>
|
|
216 <td>Win 98+ / OSX.1+</td>
|
|
217 <td class="center">1.7</td>
|
|
218 <td class="center">A</td>
|
|
219 </tr>
|
|
220 <tr class="even_gradeA">
|
|
221 <td>Gecko</td>
|
|
222 <td>Mozilla 1.8</td>
|
|
223 <td>Win 98+ / OSX.1+</td>
|
|
224 <td class="center">1.8</td>
|
|
225 <td class="center">A</td>
|
|
226 </tr>
|
|
227 <tr class="odd_gradeA">
|
|
228 <td>Gecko</td>
|
|
229 <td>Seamonkey 1.1</td>
|
|
230 <td>Win 98+ / OSX.2+</td>
|
|
231 <td class="center">1.8</td>
|
|
232 <td class="center">A</td>
|
|
233 </tr>
|
|
234 <tr class="even_gradeA">
|
|
235 <td>Gecko</td>
|
|
236 <td>Epiphany 2.20</td>
|
|
237 <td>Gnome</td>
|
|
238 <td class="center">1.8</td>
|
|
239 <td class="center">A</td>
|
|
240 </tr>
|
|
241 <tr class="odd_gradeA">
|
|
242 <td>Webkit</td>
|
|
243 <td>Safari 1.2</td>
|
|
244 <td>OSX.3</td>
|
|
245 <td class="center">125.5</td>
|
|
246 <td class="center">A</td>
|
|
247 </tr>
|
|
248 <tr class="even_gradeA">
|
|
249 <td>Webkit</td>
|
|
250 <td>Safari 1.3</td>
|
|
251 <td>OSX.3</td>
|
|
252 <td class="center">312.8</td>
|
|
253 <td class="center">A</td>
|
|
254 </tr>
|
|
255 <tr class="odd_gradeA">
|
|
256 <td>Webkit</td>
|
|
257 <td>Safari 2.0</td>
|
|
258 <td>OSX.4+</td>
|
|
259 <td class="center">419.3</td>
|
|
260 <td class="center">A</td>
|
|
261 </tr>
|
|
262 <tr class="even_gradeA">
|
|
263 <td>Webkit</td>
|
|
264 <td>Safari 3.0</td>
|
|
265 <td>OSX.4+</td>
|
|
266 <td class="center">522.1</td>
|
|
267 <td class="center">A</td>
|
|
268 </tr>
|
|
269 <tr class="odd_gradeA">
|
|
270 <td>Webkit</td>
|
|
271 <td>OmniWeb 5.5</td>
|
|
272 <td>OSX.4+</td>
|
|
273 <td class="center">420</td>
|
|
274 <td class="center">A</td>
|
|
275 </tr>
|
|
276 <tr class="even_gradeA">
|
|
277 <td>Webkit</td>
|
|
278 <td>iPod Touch / iPhone</td>
|
|
279 <td>iPod</td>
|
|
280 <td class="center">420.1</td>
|
|
281 <td class="center">A</td>
|
|
282 </tr>
|
|
283 <tr class="odd_gradeA">
|
|
284 <td>Webkit</td>
|
|
285 <td>S60</td>
|
|
286 <td>S60</td>
|
|
287 <td class="center">413</td>
|
|
288 <td class="center">A</td>
|
|
289 </tr>
|
|
290 <tr class="even_gradeA">
|
|
291 <td>Presto</td>
|
|
292 <td>Opera 7.0</td>
|
|
293 <td>Win 95+ / OSX.1+</td>
|
|
294 <td class="center">-</td>
|
|
295 <td class="center">A</td>
|
|
296 </tr>
|
|
297 <tr class="odd_gradeA">
|
|
298 <td>Presto</td>
|
|
299 <td>Opera 7.5</td>
|
|
300 <td>Win 95+ / OSX.2+</td>
|
|
301 <td class="center">-</td>
|
|
302 <td class="center">A</td>
|
|
303 </tr>
|
|
304 <tr class="even_gradeA">
|
|
305 <td>Presto</td>
|
|
306 <td>Opera 8.0</td>
|
|
307 <td>Win 95+ / OSX.2+</td>
|
|
308 <td class="center">-</td>
|
|
309 <td class="center">A</td>
|
|
310 </tr>
|
|
311 <tr class="odd_gradeA">
|
|
312 <td>Presto</td>
|
|
313 <td>Opera 8.5</td>
|
|
314 <td>Win 95+ / OSX.2+</td>
|
|
315 <td class="center">-</td>
|
|
316 <td class="center">A</td>
|
|
317 </tr>
|
|
318 <tr class="even_gradeA">
|
|
319 <td>Presto</td>
|
|
320 <td>Opera 9.0</td>
|
|
321 <td>Win 95+ / OSX.3+</td>
|
|
322 <td class="center">-</td>
|
|
323 <td class="center">A</td>
|
|
324 </tr>
|
|
325 <tr class="odd_gradeA">
|
|
326 <td>Presto</td>
|
|
327 <td>Opera 9.2</td>
|
|
328 <td>Win 88+ / OSX.3+</td>
|
|
329 <td class="center">-</td>
|
|
330 <td class="center">A</td>
|
|
331 </tr>
|
|
332 <tr class="even_gradeA">
|
|
333 <td>Presto</td>
|
|
334 <td>Opera 9.5</td>
|
|
335 <td>Win 88+ / OSX.3+</td>
|
|
336 <td class="center">-</td>
|
|
337 <td class="center">A</td>
|
|
338 </tr>
|
|
339 <tr class="odd_gradeA">
|
|
340 <td>Presto</td>
|
|
341 <td>Opera for Wii</td>
|
|
342 <td>Wii</td>
|
|
343 <td class="center">-</td>
|
|
344 <td class="center">A</td>
|
|
345 </tr>
|
|
346 <tr class="even_gradeA">
|
|
347 <td>Presto</td>
|
|
348 <td>Nokia N800</td>
|
|
349 <td>N800</td>
|
|
350 <td class="center">-</td>
|
|
351 <td class="center">A</td>
|
|
352 </tr>
|
|
353 <tr class="odd_gradeA">
|
|
354 <td>Presto</td>
|
|
355 <td>Nintendo DS browser</td>
|
|
356 <td>Nintendo DS</td>
|
|
357 <td class="center">8.5</td>
|
|
358 <td class="center">C/A<sup>1</sup></td>
|
|
359 </tr>
|
|
360 <tr class="even_gradeC">
|
|
361 <td>KHTML</td>
|
|
362 <td>Konqureror 3.1</td>
|
|
363 <td>KDE 3.1</td>
|
|
364 <td class="center">3.1</td>
|
|
365 <td class="center">C</td>
|
|
366 </tr>
|
|
367 <tr class="odd_gradeA">
|
|
368 <td>KHTML</td>
|
|
369 <td>Konqureror 3.3</td>
|
|
370 <td>KDE 3.3</td>
|
|
371 <td class="center">3.3</td>
|
|
372 <td class="center">A</td>
|
|
373 </tr>
|
|
374 <tr class="even_gradeA">
|
|
375 <td>KHTML</td>
|
|
376 <td>Konqureror 3.5</td>
|
|
377 <td>KDE 3.5</td>
|
|
378 <td class="center">3.5</td>
|
|
379 <td class="center">A</td>
|
|
380 </tr>
|
|
381 <tr class="odd_gradeX">
|
|
382 <td>Tasman</td>
|
|
383 <td>Internet Explorer 4.5</td>
|
|
384 <td>Mac OS 8-9</td>
|
|
385 <td class="center">-</td>
|
|
386 <td class="center">X</td>
|
|
387 </tr>
|
|
388 <tr class="even_gradeC">
|
|
389 <td>Tasman</td>
|
|
390 <td>Internet Explorer 5.1</td>
|
|
391 <td>Mac OS 7.6-9</td>
|
|
392 <td class="center">1</td>
|
|
393 <td class="center">C</td>
|
|
394 </tr>
|
|
395 <tr class="odd_gradeC">
|
|
396 <td>Tasman</td>
|
|
397 <td>Internet Explorer 5.2</td>
|
|
398 <td>Mac OS 8-X</td>
|
|
399 <td class="center">1</td>
|
|
400 <td class="center">C</td>
|
|
401 </tr>
|
|
402 <tr class="even_gradeA">
|
|
403 <td>Misc</td>
|
|
404 <td>NetFront 3.1</td>
|
|
405 <td>Embedded devices</td>
|
|
406 <td class="center">-</td>
|
|
407 <td class="center">C</td>
|
|
408 </tr>
|
|
409 <tr class="odd_gradeA">
|
|
410 <td>Misc</td>
|
|
411 <td>NetFront 3.4</td>
|
|
412 <td>Embedded devices</td>
|
|
413 <td class="center">-</td>
|
|
414 <td class="center">A</td>
|
|
415 </tr>
|
|
416 <tr class="even_gradeX">
|
|
417 <td>Misc</td>
|
|
418 <td>Dillo 0.8</td>
|
|
419 <td>Embedded devices</td>
|
|
420 <td class="center">-</td>
|
|
421 <td class="center">X</td>
|
|
422 </tr>
|
|
423 <tr class="odd_gradeX">
|
|
424 <td>Misc</td>
|
|
425 <td>Links</td>
|
|
426 <td>Text only</td>
|
|
427 <td class="center">-</td>
|
|
428 <td class="center">X</td>
|
|
429 </tr>
|
|
430 <tr class="even_gradeX">
|
|
431 <td>Misc</td>
|
|
432 <td>Lynx</td>
|
|
433 <td>Text only</td>
|
|
434 <td class="center">-</td>
|
|
435 <td class="center">X</td>
|
|
436 </tr>
|
|
437 <tr class="odd_gradeC">
|
|
438 <td>Misc</td>
|
|
439 <td>IE Mobile</td>
|
|
440 <td>Windows Mobile 6</td>
|
|
441 <td class="center">-</td>
|
|
442 <td class="center">C</td>
|
|
443 </tr>
|
|
444 <tr class="even_gradeC">
|
|
445 <td>Misc</td>
|
|
446 <td>PSP browser</td>
|
|
447 <td>PSP</td>
|
|
448 <td class="center">-</td>
|
|
449 <td class="center">C</td>
|
|
450 </tr>
|
|
451 <tr class="odd_gradeU">
|
|
452 <td>Other browsers</td>
|
|
453 <td>All others</td>
|
|
454 <td>-</td>
|
|
455 <td class="center">-</td>
|
|
456 <td class="center">U</td>
|
|
457 </tr>
|
|
458 </tbody>
|
|
459 </table>
|
|
460 </div>
|
|
461 <div class="spacer"></div>
|
|
462
|
|
463
|
|
464 <h1>Initialisation code</h1>
|
|
465 <pre>$(document).ready( function () {
|
|
466 TableTools.DEFAULTS.aButtons = [ "copy", "csv", "xls" ];
|
|
467
|
|
468 $('#example').dataTable( {
|
|
469 "sDom": 'T<"clear">lfrtip'
|
|
470 } );
|
|
471 } );</pre>
|
|
472
|
|
473
|
|
474 <h1>Other examples</h1>
|
|
475 <ul>
|
|
476 <li><a href="index.html">Basic initialisation</a></li>
|
|
477 <li><a href="swf_path.html">Setting the SWF path</a></li>
|
|
478 <li><a href="alter_buttons.html">Custom button arrangement</a></li>
|
|
479 <li><a href="button_text.html">Button text alteration</a></li>
|
|
480 <li><a href="collection.html">Using button collections</a></li>
|
|
481 <li><a href="theme.html">Using jQuery UI themes</a></li>
|
|
482 <li><a href="bootstrap.html">Styling with Twitter Bootstrap</a></li>
|
|
483 <li><a href="multi_instance.html">Multiple TableTools toolbars for a single table</a></li>
|
|
484 <li><a href="multiple_tables.html">Multiple DataTables with a single initialisation</a></li>
|
|
485 <li><a href="select_multi.html">User selectable rows (multiple rows)</a></li>
|
|
486 <li><a href="select_single.html">User selectable rows (single row)</a></li>
|
|
487 <li><a href="alt_init.html">Alternative initialisation using 'new TableTools()'</a></li>
|
|
488 <li><a href="defaults.html">Altering the TableTools defaults</a></li>
|
|
489 <li><a href="plug-in.html">TableTools plug-in buttons</a></li>
|
|
490 <li><a href="pdf_message.html">Customising the PDF output (adding text and orientation)</a></li>
|
|
491 </ul>
|
|
492
|
|
493
|
|
494 <div id="footer" style="text-align:center;">
|
|
495 <span style="font-size:10px;">
|
|
496 TableTools and DataTables © Allan Jardine 2009-2011.<br>
|
|
497 Flash 10 save / copy operations are performed by a modified version of <a href="http://code.google.com/p/zeroclipboard/">Zero Clipboard</a>.<br>
|
|
498 The icons used in the toolbar are modified from <a href="http://www.addictedtocoffee.de/">Oliver Twardowski's</a> <a href="http://www.smashingmagazine.com/2009/05/20/flavour-extended-the-ultimate-icon-set-for-web-designers/">Flavours Icon set</a>.
|
|
499 </span>
|
|
500 </div>
|
|
501 </div>
|
|
502 </body>
|
|
503 </html> |