1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
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">
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_jui.css";
11 @import "../../examples/examples_support/themes/smoothness/jquery-ui-1.8.4.custom.css";
12 @import "media/css/TableTools_JUI.css";
13 .ui-tabs .ui-tabs-panel { padding: 10px }
15 <script type="text/javascript" charset="utf-8" src="../../media/js/jquery.js"></script>
16 <script type="text/javascript" charset="utf-8" src="../../media/js/jquery.dataTables.js"></script>
17 <script type="text/javascript" charset="utf-8" src="../../examples/examples_support/jquery-ui-tabs.js"></script>
18 <script type="text/javascript" charset="utf-8" src="media/js/ZeroClipboard.js"></script>
19 <script type="text/javascript" charset="utf-8" src="media/js/TableTools.js"></script>
20 <script type="text/javascript" charset="utf-8">
21 $(document).ready(function() {
23 "show": function(event, ui) {
24 var jqTable = $('table.display', ui.panel);
25 if ( jqTable.length > 0 ) {
26 var oTableTools = TableTools.fnGetInstance( jqTable[0] );
27 if ( oTableTools != null && oTableTools.fnResizeRequired() )
29 /* A resize of TableTools' buttons and DataTables' columns is only required on the
30 * first visible draw of the table
32 jqTable.dataTable().fnAdjustColumnSizing();
33 oTableTools.fnResizeButtons();
39 $('#example1').dataTable( {
41 "sPaginationType": "full_numbers",
42 "sDom": '<"H"Tfr>t<"F"ip>'
45 $('#example2').dataTable( {
47 "sPaginationType": "full_numbers",
48 "sDom": '<"H"Tfr>t<"F"ip>'
53 <body id="dt_example">
55 <div class="full_width big">
60 <p>This example shows the basic initialisation of TableTools by simply including the 'T' marker in DataTables' sDom parameter. This tell DataTables to insert the TableTools toolbar in that location. Remember to include the Javascript and CSS source files as well!</p>
61 <p>It is worth noting that you might need to <a href="swf_path.html">set the <i>sSwfPath</i> parameter</a> to tell TableTools where to find the SWF file for copy and file save.</p>
67 <li><a href="#tabs-1">Trident browsers</a></li>
68 <li><a href="#tabs-2">Gecko browsers</a></li>
72 <table cellpadding="0" cellspacing="0" border="0" class="display" id="example1">
75 <th>Rendering engine</th>
78 <th>Engine version</th>
84 <th>Rendering engine</th>
87 <th>Engine version</th>
92 <tr class="odd gradeX">
97 <td class="center">4</td>
98 <td class="center">X</td>
100 <tr class="odd gradeC">
105 <td class="center">5</td>
106 <td class="center">C</td>
108 <tr class="odd gradeA">
113 <td class="center">5.5</td>
114 <td class="center">A</td>
116 <tr class="odd gradeA">
121 <td class="center">6</td>
122 <td class="center">A</td>
124 <tr class="odd gradeA">
126 <td>Internet Explorer 7</td>
128 <td class="center">7</td>
129 <td class="center">A</td>
131 <tr class="odd gradeA">
133 <td>AOL browser (AOL desktop)</td>
135 <td class="center">6</td>
136 <td class="center">A</td>
144 <table cellpadding="0" cellspacing="0" border="0" class="display" id="example2">
147 <th>Rendering engine</th>
150 <th>Engine version</th>
156 <th>Rendering engine</th>
159 <th>Engine version</th>
167 <td>Win 98+ / OSX.2+</td>
168 <td class="center">1.7</td>
169 <td class="center">A</td>
174 <td>Win 98+ / OSX.2+</td>
175 <td class="center">1.8</td>
176 <td class="center">A</td>
181 <td>Win 98+ / OSX.2+</td>
182 <td class="center">1.8</td>
183 <td class="center">A</td>
188 <td>Win 2k+ / OSX.3+</td>
189 <td class="center">1.9</td>
190 <td class="center">A</td>
196 <td class="center">1.8</td>
197 <td class="center">A</td>
203 <td class="center">1.8</td>
204 <td class="center">A</td>
208 <td>Netscape 7.2</td>
209 <td>Win 95+ / Mac OS 8.6-9.2</td>
210 <td class="center">1.7</td>
211 <td class="center">A</td>
215 <td>Netscape Browser 8</td>
217 <td class="center">1.7</td>
218 <td class="center">A</td>
222 <td>Netscape Navigator 9</td>
223 <td>Win 98+ / OSX.2+</td>
224 <td class="center">1.8</td>
225 <td class="center">A</td>
230 <td>Win 95+ / OSX.1+</td>
231 <td class="center">1</td>
232 <td class="center">A</td>
237 <td>Win 95+ / OSX.1+</td>
238 <td class="center">1.1</td>
239 <td class="center">A</td>
244 <td>Win 95+ / OSX.1+</td>
245 <td class="center">1.2</td>
246 <td class="center">A</td>
251 <td>Win 95+ / OSX.1+</td>
252 <td class="center">1.3</td>
253 <td class="center">A</td>
258 <td>Win 95+ / OSX.1+</td>
259 <td class="center">1.4</td>
260 <td class="center">A</td>
265 <td>Win 95+ / OSX.1+</td>
266 <td class="center">1.5</td>
267 <td class="center">A</td>
272 <td>Win 95+ / OSX.1+</td>
273 <td class="center">1.6</td>
274 <td class="center">A</td>
279 <td>Win 98+ / OSX.1+</td>
280 <td class="center">1.7</td>
281 <td class="center">A</td>
286 <td>Win 98+ / OSX.1+</td>
287 <td class="center">1.8</td>
288 <td class="center">A</td>
292 <td>Seamonkey 1.1</td>
293 <td>Win 98+ / OSX.2+</td>
294 <td class="center">1.8</td>
295 <td class="center">A</td>
299 <td>Epiphany 2.20</td>
301 <td class="center">1.8</td>
302 <td class="center">A</td>
309 <div class="spacer"></div>
311 <h1>Initialisation code</h1>
312 <pre>$(document).ready( function () {
313 $('#example').dataTable( {
314 "sDom": 'T<"clear">lfrtip'
319 <h1>Other examples</h1>
321 <li><a href="index.html">Basic initialisation</a></li>
322 <li><a href="swf_path.html">Setting the SWF path</a></li>
323 <li><a href="alter_buttons.html">Custom button arrangement</a></li>
324 <li><a href="button_text.html">Button text alteration</a></li>
325 <li><a href="collection.html">Using button collections</a></li>
326 <li><a href="theme.html">Using jQuery UI themes</a></li>
327 <li><a href="bootstrap.html">Styling with Twitter Bootstrap</a></li>
328 <li><a href="multi_instance.html">Multiple TableTools toolbars for a single table</a></li>
329 <li><a href="multiple_tables.html">Multiple DataTables with a single initialisation</a></li>
330 <li><a href="select_multi.html">User selectable rows (multiple rows)</a></li>
331 <li><a href="select_single.html">User selectable rows (single row)</a></li>
332 <li><a href="alt_init.html">Alternative initialisation using 'new TableTools()'</a></li>
333 <li><a href="defaults.html">Altering the TableTools defaults</a></li>
334 <li><a href="plug-in.html">TableTools plug-in buttons</a></li>
335 <li><a href="pdf_message.html">Customising the PDF output (adding text and orientation)</a></li>
339 <div id="footer" style="text-align:center;">
340 <span style="font-size:10px;">
341 TableTools and DataTables © Allan Jardine 2009-2011.<br>
342 Flash 10 save / copy operations are performed by a modified version of <a href="http://code.google.com/p/zeroclipboard/">Zero Clipboard</a>.<br>
343 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>.