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">
8 <title>TableTools example - Basic initialisation</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">
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">
24 $(document).ready(function() {
25 $('#example').DataTable( {
26 dom: 'T<"clear">lfrtip'
34 <body class="dt-example">
35 <div class="container">
37 <h1>TableTools example <span>Basic initialisation</span></h1>
40 <p>This example shows the basic initialisation of TableTools by simply including the <code class="string" title="String">T</code> option in DataTables' <a href=
41 "//datatables.net/reference/option/dom"><code class="option" title="DataTables initialisation option">dom<span>DT</span></code></a> parameter. This tell DataTables
42 to insert the TableTools toolbar in that location. Remember to include the Javascript and CSS source files as well!</p>
44 <p>It is worth noting that you might need to <a href="swf_path.html">set the <code>sSwfPath</code> parameter</a> to tell TableTools where to find the SWF file for
45 copy and file save.</p>
48 <table id="example" class="display" cellspacing="0" width="100%">
74 <td>System Architect</td>
81 <td>Garrett Winters</td>
90 <td>Junior Technical Author</td>
91 <td>San Francisco</td>
98 <td>Senior Javascript Developer</td>
113 <td>Brielle Williamson</td>
114 <td>Integration Specialist</td>
121 <td>Herrod Chandler</td>
122 <td>Sales Assistant</td>
123 <td>San Francisco</td>
129 <td>Rhona Davidson</td>
130 <td>Integration Specialist</td>
137 <td>Colleen Hurst</td>
138 <td>Javascript Developer</td>
139 <td>San Francisco</td>
146 <td>Software Engineer</td>
154 <td>Office Manager</td>
162 <td>Support Lead</td>
169 <td>Charde Marshall</td>
170 <td>Regional Director</td>
171 <td>San Francisco</td>
177 <td>Haley Kennedy</td>
178 <td>Senior Marketing Designer</td>
185 <td>Tatyana Fitzpatrick</td>
186 <td>Regional Director</td>
193 <td>Michael Silva</td>
194 <td>Marketing Designer</td>
202 <td>Chief Financial Officer (CFO)</td>
209 <td>Gloria Little</td>
210 <td>Systems Administrator</td>
217 <td>Bradley Greer</td>
218 <td>Software Engineer</td>
226 <td>Personnel Lead</td>
233 <td>Jenette Caldwell</td>
234 <td>Development Lead</td>
242 <td>Chief Marketing Officer (CMO)</td>
249 <td>Caesar Vance</td>
250 <td>Pre-Sales Support</td>
257 <td>Doris Wilder</td>
258 <td>Sales Assistant</td>
265 <td>Angelica Ramos</td>
266 <td>Chief Executive Officer (CEO)</td>
281 <td>Jennifer Chang</td>
282 <td>Regional Director</td>
289 <td>Brenden Wagner</td>
290 <td>Software Engineer</td>
291 <td>San Francisco</td>
298 <td>Chief Operating Officer (COO)</td>
299 <td>San Francisco</td>
306 <td>Regional Marketing</td>
313 <td>Michelle House</td>
314 <td>Integration Specialist</td>
329 <td>Prescott Bartlett</td>
330 <td>Technical Author</td>
337 <td>Gavin Cortez</td>
339 <td>San Francisco</td>
345 <td>Martena Mccray</td>
346 <td>Post-Sales support</td>
353 <td>Unity Butler</td>
354 <td>Marketing Designer</td>
355 <td>San Francisco</td>
361 <td>Howard Hatfield</td>
362 <td>Office Manager</td>
363 <td>San Francisco</td>
369 <td>Hope Fuentes</td>
371 <td>San Francisco</td>
377 <td>Vivian Harrell</td>
378 <td>Financial Controller</td>
379 <td>San Francisco</td>
385 <td>Timothy Mooney</td>
386 <td>Office Manager</td>
393 <td>Jackson Bradshaw</td>
401 <td>Olivia Liang</td>
402 <td>Support Engineer</td>
410 <td>Software Engineer</td>
417 <td>Sakura Yamamoto</td>
418 <td>Support Engineer</td>
433 <td>Finn Camacho</td>
434 <td>Support Engineer</td>
435 <td>San Francisco</td>
441 <td>Serge Baldwin</td>
442 <td>Data Coordinator</td>
449 <td>Zenaida Frank</td>
450 <td>Software Engineer</td>
457 <td>Zorita Serrano</td>
458 <td>Software Engineer</td>
459 <td>San Francisco</td>
465 <td>Jennifer Acosta</td>
466 <td>Junior Javascript Developer</td>
473 <td>Cara Stevens</td>
474 <td>Sales Assistant</td>
481 <td>Hermione Butler</td>
482 <td>Regional Director</td>
490 <td>Systems Administrator</td>
497 <td>Jonas Alexander</td>
499 <td>San Francisco</td>
506 <td>Regional Director</td>
513 <td>Michael Bruce</td>
514 <td>Javascript Developer</td>
521 <td>Donna Snider</td>
522 <td>Customer Support</td>
532 <li class="active">Javascript</li>
536 <li>Server-side script</li>
541 <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
542 $('#example').DataTable( {
543 dom: 'T<"clear">lfrtip'
547 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
550 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
551 <li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
552 <li><a href="../js/dataTables.tableTools.js">../js/dataTables.tableTools.js</a></li>
557 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
562 <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
563 additional CSS used is shown below:</p><code class="multiline language-css"></code>
566 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
569 <li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
570 <li><a href="../css/dataTables.tableTools.css">../css/dataTables.tableTools.css</a></li>
575 <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
580 <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
581 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
582 documentation</a>.</p>
590 <div class="gradient"></div>
593 <h2>Other examples</h2>
596 <div class="toc-group">
597 <h3><a href="./index.html">Examples</a></h3>
598 <ul class="toc active">
599 <li class="active"><a href="./simple.html">Basic initialisation</a></li>
600 <li><a href="./swf_path.html">Setting the SWF path</a></li>
601 <li><a href="./new_init.html">Initialisation with `new`</a></li>
602 <li><a href="./defaults.html">Defaults</a></li>
603 <li><a href="./select_single.html">Row selection - single row select</a></li>
604 <li><a href="./select_multi.html">Row selection - multi-row select</a></li>
605 <li><a href="./select_os.html">Row selection - operating system style</a></li>
606 <li><a href="./select_column.html">Row selection - row selector on specific cells</a></li>
607 <li><a href="./multiple_tables.html">Multiple tables</a></li>
608 <li><a href="./multi_instance.html">Multiple toolbars</a></li>
609 <li><a href="./collection.html">Button collections</a></li>
610 <li><a href="./plug-in.html">Plug-in button types</a></li>
611 <li><a href="./button_text.html">Custom button text</a></li>
612 <li><a href="./alter_buttons.html">Button arrangement</a></li>
613 <li><a href="./ajax.html">Ajax loaded data</a></li>
614 <li><a href="./pdf_message.html">PDF message</a></li>
615 <li><a href="./bootstrap.html">Bootstrap styling</a></li>
616 <li><a href="./jqueryui.html">jQuery UI styling</a></li>
621 <div class="epilogue">
622 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
623 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>
624 which extend the capabilities of DataTables.</p>
626 <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2015<br>
627 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>