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