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>FixedHeader example - Header and footer fixed
</title>
9 <link rel=
"stylesheet" type=
"text/css" href=
"../../../media/css/jquery.dataTables.css">
10 <link rel=
"stylesheet" type=
"text/css" href=
"../css/dataTables.fixedHeader.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.fixedHeader.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 var table = $('#example').DataTable();
27 new $.fn.dataTable.FixedHeader( table, {
36 <body class=
"dt-example">
37 <div class=
"container">
39 <h1>FixedHeader example
<span>Header and footer fixed
</span></h1>
42 <p>FixedHeader provides the ability to fix in place the header, footer, left and right columns of the
43 table. These are controlled by the options:
</p>
46 <li><code>top
</code> - default true
</li>
47 <li><code>bottom
</code> - default false
</li>
48 <li><code>left
</code> - default false
</li>
49 <li><code>right
</code> - default false
</li>
52 <p>This example shows the header and footer of the table fixed by enabling the
<code>bottom
</code>
56 <table id=
"example" class=
"display" cellspacing=
"0" width=
"100%">
82 <td>System Architect
</td>
89 <td>Garrett Winters
</td>
98 <td>Junior Technical Author
</td>
99 <td>San Francisco
</td>
105 <td>Cedric Kelly
</td>
106 <td>Senior Javascript Developer
</td>
121 <td>Brielle Williamson
</td>
122 <td>Integration Specialist
</td>
129 <td>Herrod Chandler
</td>
130 <td>Sales Assistant
</td>
131 <td>San Francisco
</td>
137 <td>Rhona Davidson
</td>
138 <td>Integration Specialist
</td>
145 <td>Colleen Hurst
</td>
146 <td>Javascript Developer
</td>
147 <td>San Francisco
</td>
154 <td>Software Engineer
</td>
162 <td>Office Manager
</td>
170 <td>Support Lead
</td>
177 <td>Charde Marshall
</td>
178 <td>Regional Director
</td>
179 <td>San Francisco
</td>
185 <td>Haley Kennedy
</td>
186 <td>Senior Marketing Designer
</td>
193 <td>Tatyana Fitzpatrick
</td>
194 <td>Regional Director
</td>
201 <td>Michael Silva
</td>
202 <td>Marketing Designer
</td>
210 <td>Chief Financial Officer (CFO)
</td>
217 <td>Gloria Little
</td>
218 <td>Systems Administrator
</td>
225 <td>Bradley Greer
</td>
226 <td>Software Engineer
</td>
234 <td>Personnel Lead
</td>
241 <td>Jenette Caldwell
</td>
242 <td>Development Lead
</td>
250 <td>Chief Marketing Officer (CMO)
</td>
257 <td>Caesar Vance
</td>
258 <td>Pre-Sales Support
</td>
265 <td>Doris Wilder
</td>
266 <td>Sales Assistant
</td>
273 <td>Angelica Ramos
</td>
274 <td>Chief Executive Officer (CEO)
</td>
289 <td>Jennifer Chang
</td>
290 <td>Regional Director
</td>
297 <td>Brenden Wagner
</td>
298 <td>Software Engineer
</td>
299 <td>San Francisco
</td>
306 <td>Chief Operating Officer (COO)
</td>
307 <td>San Francisco
</td>
314 <td>Regional Marketing
</td>
321 <td>Michelle House
</td>
322 <td>Integration Specialist
</td>
337 <td>Prescott Bartlett
</td>
338 <td>Technical Author
</td>
345 <td>Gavin Cortez
</td>
347 <td>San Francisco
</td>
353 <td>Martena Mccray
</td>
354 <td>Post-Sales support
</td>
361 <td>Unity Butler
</td>
362 <td>Marketing Designer
</td>
363 <td>San Francisco
</td>
369 <td>Howard Hatfield
</td>
370 <td>Office Manager
</td>
371 <td>San Francisco
</td>
377 <td>Hope Fuentes
</td>
379 <td>San Francisco
</td>
385 <td>Vivian Harrell
</td>
386 <td>Financial Controller
</td>
387 <td>San Francisco
</td>
393 <td>Timothy Mooney
</td>
394 <td>Office Manager
</td>
401 <td>Jackson Bradshaw
</td>
409 <td>Olivia Liang
</td>
410 <td>Support Engineer
</td>
418 <td>Software Engineer
</td>
425 <td>Sakura Yamamoto
</td>
426 <td>Support Engineer
</td>
441 <td>Finn Camacho
</td>
442 <td>Support Engineer
</td>
443 <td>San Francisco
</td>
449 <td>Serge Baldwin
</td>
450 <td>Data Coordinator
</td>
457 <td>Zenaida Frank
</td>
458 <td>Software Engineer
</td>
465 <td>Zorita Serrano
</td>
466 <td>Software Engineer
</td>
467 <td>San Francisco
</td>
473 <td>Jennifer Acosta
</td>
474 <td>Junior Javascript Developer
</td>
481 <td>Cara Stevens
</td>
482 <td>Sales Assistant
</td>
489 <td>Hermione Butler
</td>
490 <td>Regional Director
</td>
498 <td>Systems Administrator
</td>
505 <td>Jonas Alexander
</td>
507 <td>San Francisco
</td>
514 <td>Regional Director
</td>
521 <td>Michael Bruce
</td>
522 <td>Javascript Developer
</td>
529 <td>Donna Snider
</td>
530 <td>Customer Support
</td>
540 <li class=
"active">Javascript
</li>
544 <li>Server-side script
</li>
549 <p>The Javascript shown below is used to initialise the table shown in this
550 example:
</p><code class=
"multiline brush: js;">$(document).ready(function() {
551 var table = $('#example').DataTable();
553 new $.fn.dataTable.FixedHeader( table, {
558 <p>In addition to the above code, the following Javascript library files are loaded for use in this
562 <li><a href=
"../../../media/js/jquery.js">../../../media/js/jquery.js
</a></li>
564 "../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js
</a></li>
565 <li><a href=
"../js/dataTables.fixedHeader.js">../js/dataTables.fixedHeader.js
</a></li>
570 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by
576 <p>This example uses a little bit of additional CSS beyond what is loaded from the library
577 files (below), in order to correctly display the table. The additional CSS used is shown
578 below:
</p><code class=
"multiline brush: js;"></code>
581 <p>The following CSS library files are loaded for use in this example to provide the styling of the
586 "../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css
</a></li>
587 <li><a href=
"../css/dataTables.fixedHeader.css">../css/dataTables.fixedHeader.css
</a></li>
592 <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data
593 will update automatically as any additional data is loaded.
</p>
597 <p>The script used to perform the server-side processing for this table is shown below. Please note
598 that this is just an example script using PHP. Server-side processing scripts can be written in any
599 language, using
<a href=
"//datatables.net/manual/server-side">the protocol described in the
600 DataTables documentation
</a>.
</p>
608 <div class=
"gradient"></div>
611 <h2>Other examples
</h2>
614 <div class=
"toc-group">
615 <h3><a href=
"./index.html">Examples
</a></h3>
616 <ul class=
"toc active">
617 <li><a href=
"./simple.html">Basic initialisation
</a></li>
618 <li class=
"active"><a href=
"./header_footer.html">Header and footer fixed
</a></li>
619 <li><a href=
"./top_left_right.html">Header, left and right all fixed
</a></li>
620 <li><a href=
"./two_tables.html">Multiple tables
</a></li>
621 <li><a href=
"./zIndexes.html">z-index order control
</a></li>
626 <div class=
"epilogue">
627 <p>Please refer to the
<a href=
"http://www.datatables.net">DataTables documentation
</a> for full
628 information about its API properties and methods.
<br>
629 Additionally, there are a wide range of
<a href=
"http://www.datatables.net/extras">extras
</a> and
630 <a href=
"http://www.datatables.net/plug-ins">plug-ins
</a> which extend the capabilities of
633 <p class=
"copyright">DataTables designed and created by
<a href=
634 "http://www.sprymedia.co.uk">SpryMedia Ltd
</a> © 2007-
2014<br>
635 DataTables is licensed under the
<a href=
"http://www.datatables.net/mit">MIT license
</a>.
</p>