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 - Defaults
</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 $.fn.dataTable.TableTools.defaults.aButtons = [
"copy",
"csv",
"xls" ];
26 $(document).ready(function() {
27 $('#example').DataTable( {
28 dom: 'T<
"clear">lfrtip'
36 <body class=
"dt-example">
37 <div class=
"container">
39 <h1>TableTools example
<span>Defaults
</span></h1>
42 <p>TableTools provides the ability to override the default initialisation parameters that are used when creating a new instance. This this particularly useful if
43 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
44 once. This example shows how to alter the default buttons.
</p>
47 <table id=
"example" class=
"display" cellspacing=
"0" width=
"100%">
73 <td>System Architect
</td>
80 <td>Garrett Winters
</td>
89 <td>Junior Technical Author
</td>
90 <td>San Francisco
</td>
97 <td>Senior Javascript Developer
</td>
112 <td>Brielle Williamson
</td>
113 <td>Integration Specialist
</td>
120 <td>Herrod Chandler
</td>
121 <td>Sales Assistant
</td>
122 <td>San Francisco
</td>
128 <td>Rhona Davidson
</td>
129 <td>Integration Specialist
</td>
136 <td>Colleen Hurst
</td>
137 <td>Javascript Developer
</td>
138 <td>San Francisco
</td>
145 <td>Software Engineer
</td>
153 <td>Office Manager
</td>
161 <td>Support Lead
</td>
168 <td>Charde Marshall
</td>
169 <td>Regional Director
</td>
170 <td>San Francisco
</td>
176 <td>Haley Kennedy
</td>
177 <td>Senior Marketing Designer
</td>
184 <td>Tatyana Fitzpatrick
</td>
185 <td>Regional Director
</td>
192 <td>Michael Silva
</td>
193 <td>Marketing Designer
</td>
201 <td>Chief Financial Officer (CFO)
</td>
208 <td>Gloria Little
</td>
209 <td>Systems Administrator
</td>
216 <td>Bradley Greer
</td>
217 <td>Software Engineer
</td>
225 <td>Personnel Lead
</td>
232 <td>Jenette Caldwell
</td>
233 <td>Development Lead
</td>
241 <td>Chief Marketing Officer (CMO)
</td>
248 <td>Caesar Vance
</td>
249 <td>Pre-Sales Support
</td>
256 <td>Doris Wilder
</td>
257 <td>Sales Assistant
</td>
264 <td>Angelica Ramos
</td>
265 <td>Chief Executive Officer (CEO)
</td>
280 <td>Jennifer Chang
</td>
281 <td>Regional Director
</td>
288 <td>Brenden Wagner
</td>
289 <td>Software Engineer
</td>
290 <td>San Francisco
</td>
297 <td>Chief Operating Officer (COO)
</td>
298 <td>San Francisco
</td>
305 <td>Regional Marketing
</td>
312 <td>Michelle House
</td>
313 <td>Integration Specialist
</td>
328 <td>Prescott Bartlett
</td>
329 <td>Technical Author
</td>
336 <td>Gavin Cortez
</td>
338 <td>San Francisco
</td>
344 <td>Martena Mccray
</td>
345 <td>Post-Sales support
</td>
352 <td>Unity Butler
</td>
353 <td>Marketing Designer
</td>
354 <td>San Francisco
</td>
360 <td>Howard Hatfield
</td>
361 <td>Office Manager
</td>
362 <td>San Francisco
</td>
368 <td>Hope Fuentes
</td>
370 <td>San Francisco
</td>
376 <td>Vivian Harrell
</td>
377 <td>Financial Controller
</td>
378 <td>San Francisco
</td>
384 <td>Timothy Mooney
</td>
385 <td>Office Manager
</td>
392 <td>Jackson Bradshaw
</td>
400 <td>Olivia Liang
</td>
401 <td>Support Engineer
</td>
409 <td>Software Engineer
</td>
416 <td>Sakura Yamamoto
</td>
417 <td>Support Engineer
</td>
432 <td>Finn Camacho
</td>
433 <td>Support Engineer
</td>
434 <td>San Francisco
</td>
440 <td>Serge Baldwin
</td>
441 <td>Data Coordinator
</td>
448 <td>Zenaida Frank
</td>
449 <td>Software Engineer
</td>
456 <td>Zorita Serrano
</td>
457 <td>Software Engineer
</td>
458 <td>San Francisco
</td>
464 <td>Jennifer Acosta
</td>
465 <td>Junior Javascript Developer
</td>
472 <td>Cara Stevens
</td>
473 <td>Sales Assistant
</td>
480 <td>Hermione Butler
</td>
481 <td>Regional Director
</td>
489 <td>Systems Administrator
</td>
496 <td>Jonas Alexander
</td>
498 <td>San Francisco
</td>
505 <td>Regional Director
</td>
512 <td>Michael Bruce
</td>
513 <td>Javascript Developer
</td>
520 <td>Donna Snider
</td>
521 <td>Customer Support
</td>
531 <li class=
"active">Javascript
</li>
535 <li>Server-side script
</li>
540 <p>The Javascript shown below is used to initialise the table shown in this example:
</p><code class=
"multiline language-js">$.fn.dataTable.TableTools.defaults.aButtons = [
"copy
",
"csv
",
"xls
" ];
542 $(document).ready(function() {
543 $('#example').DataTable( {
544 dom: 'T
<"clear
">lfrtip'
548 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:
</p>
551 <li><a href=
"../../../media/js/jquery.js">../../../media/js/jquery.js
</a></li>
552 <li><a href=
"../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js
</a></li>
553 <li><a href=
"../js/dataTables.tableTools.js">../js/dataTables.tableTools.js
</a></li>
558 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:
</p>
563 <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
564 additional CSS used is shown below:
</p><code class=
"multiline language-css"></code>
567 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:
</p>
570 <li><a href=
"../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css
</a></li>
571 <li><a href=
"../css/dataTables.tableTools.css">../css/dataTables.tableTools.css
</a></li>
576 <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
581 <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
582 processing scripts can be written in any language, using
<a href=
"//datatables.net/manual/server-side">the protocol described in the DataTables
583 documentation
</a>.
</p>
591 <div class=
"gradient"></div>
594 <h2>Other examples
</h2>
597 <div class=
"toc-group">
598 <h3><a href=
"./index.html">Examples
</a></h3>
599 <ul class=
"toc active">
600 <li><a href=
"./simple.html">Basic initialisation
</a></li>
601 <li><a href=
"./swf_path.html">Setting the SWF path
</a></li>
602 <li><a href=
"./new_init.html">Initialisation with `new`
</a></li>
603 <li class=
"active"><a href=
"./defaults.html">Defaults
</a></li>
604 <li><a href=
"./select_single.html">Row selection - single row select
</a></li>
605 <li><a href=
"./select_multi.html">Row selection - multi-row select
</a></li>
606 <li><a href=
"./select_os.html">Row selection - operating system style
</a></li>
607 <li><a href=
"./select_column.html">Row selection - row selector on specific cells
</a></li>
608 <li><a href=
"./multiple_tables.html">Multiple tables
</a></li>
609 <li><a href=
"./multi_instance.html">Multiple toolbars
</a></li>
610 <li><a href=
"./collection.html">Button collections
</a></li>
611 <li><a href=
"./plug-in.html">Plug-in button types
</a></li>
612 <li><a href=
"./button_text.html">Custom button text
</a></li>
613 <li><a href=
"./alter_buttons.html">Button arrangement
</a></li>
614 <li><a href=
"./ajax.html">Ajax loaded data
</a></li>
615 <li><a href=
"./pdf_message.html">PDF message
</a></li>
616 <li><a href=
"./bootstrap.html">Bootstrap styling
</a></li>
617 <li><a href=
"./jqueryui.html">jQuery UI styling
</a></li>
622 <div class=
"epilogue">
623 <p>Please refer to the
<a href=
"http://www.datatables.net">DataTables documentation
</a> for full information about its API properties and methods.
<br>
624 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>
625 which extend the capabilities of DataTables.
</p>
627 <p class=
"copyright">DataTables designed and created by
<a href=
"http://www.sprymedia.co.uk">SpryMedia Ltd
</a> © 2007-
2015<br>
628 DataTables is licensed under the
<a href=
"http://www.datatables.net/mit">MIT license
</a>.
</p>