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>FixedColumns example - Individual column filtering</title>
9 <link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
10 <link rel="stylesheet" type="text/css" href="../css/dataTables.fixedColumns.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">
15 /* Ensure that the demo table scrolls */
16 th, td { white-space: nowrap; }
17 div.dataTables_wrapper {
23 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
24 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
25 <script type="text/javascript" language="javascript" src="../js/dataTables.fixedColumns.js"></script>
26 <script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
27 <script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
28 <script type="text/javascript" language="javascript" class="init">
31 $(document).ready(function() {
32 // Setup - add a text input to each footer cell
33 $('#example tfoot th').each( function () {
34 var title = $('#example thead th').eq( $(this).index() ).text();
35 $(this).html( '<input type="text" placeholder="Search '+title+'" />' );
39 var table = $('#example').DataTable( {
47 table.columns().indexes().each( function (idx) {
48 $( 'input', table.column( idx ).footer() ).on( 'keyup change', function () {
56 new $.fn.dataTable.FixedColumns( table );
63 <body class="dt-example">
64 <div class="container">
66 <h1>FixedColumns example <span>Individual column filtering</span></h1>
69 <p>This example shows FixedColumns being configured with individual column filtering abilities. Note that the event handler for the filtering is applied to the
70 <code class="tag" title="HTML tag">input</code> elements before FixedColumns is initialised, so when FixedColumns clones nodes it also copies the event.</p>
73 <table id="example" class="stripe row-border order-column" cellspacing="0" width="100%">
106 <td>System Architect</td>
112 <td>t.nixon@datatables.net</td>
123 <td>g.winters@datatables.net</td>
128 <td>Junior Technical Author</td>
129 <td>San Francisco</td>
134 <td>a.cox@datatables.net</td>
139 <td>Senior Javascript Developer</td>
145 <td>c.kelly@datatables.net</td>
156 <td>a.satou@datatables.net</td>
161 <td>Integration Specialist</td>
167 <td>b.williamson@datatables.net</td>
172 <td>Sales Assistant</td>
173 <td>San Francisco</td>
178 <td>h.chandler@datatables.net</td>
183 <td>Integration Specialist</td>
189 <td>r.davidson@datatables.net</td>
194 <td>Javascript Developer</td>
195 <td>San Francisco</td>
200 <td>c.hurst@datatables.net</td>
205 <td>Software Engineer</td>
211 <td>s.frost@datatables.net</td>
216 <td>Office Manager</td>
222 <td>j.gaines@datatables.net</td>
227 <td>Support Lead</td>
233 <td>q.flynn@datatables.net</td>
238 <td>Regional Director</td>
239 <td>San Francisco</td>
244 <td>c.marshall@datatables.net</td>
249 <td>Senior Marketing Designer</td>
255 <td>h.kennedy@datatables.net</td>
260 <td>Regional Director</td>
266 <td>t.fitzpatrick@datatables.net</td>
271 <td>Marketing Designer</td>
277 <td>m.silva@datatables.net</td>
282 <td>Chief Financial Officer (CFO)</td>
288 <td>p.byrd@datatables.net</td>
293 <td>Systems Administrator</td>
299 <td>g.little@datatables.net</td>
304 <td>Software Engineer</td>
310 <td>b.greer@datatables.net</td>
315 <td>Personnel Lead</td>
321 <td>d.rios@datatables.net</td>
326 <td>Development Lead</td>
332 <td>j.caldwell@datatables.net</td>
337 <td>Chief Marketing Officer (CMO)</td>
343 <td>y.berry@datatables.net</td>
348 <td>Pre-Sales Support</td>
354 <td>c.vance@datatables.net</td>
359 <td>Sales Assistant</td>
365 <td>d.wilder@datatables.net</td>
370 <td>Chief Executive Officer (CEO)</td>
376 <td>a.ramos@datatables.net</td>
387 <td>g.joyce@datatables.net</td>
392 <td>Regional Director</td>
398 <td>j.chang@datatables.net</td>
403 <td>Software Engineer</td>
404 <td>San Francisco</td>
409 <td>b.wagner@datatables.net</td>
414 <td>Chief Operating Officer (COO)</td>
415 <td>San Francisco</td>
420 <td>f.green@datatables.net</td>
425 <td>Regional Marketing</td>
431 <td>s.itou@datatables.net</td>
436 <td>Integration Specialist</td>
442 <td>m.house@datatables.net</td>
453 <td>s.burks@datatables.net</td>
458 <td>Technical Author</td>
464 <td>p.bartlett@datatables.net</td>
470 <td>San Francisco</td>
475 <td>g.cortez@datatables.net</td>
480 <td>Post-Sales support</td>
486 <td>m.mccray@datatables.net</td>
491 <td>Marketing Designer</td>
492 <td>San Francisco</td>
497 <td>u.butler@datatables.net</td>
502 <td>Office Manager</td>
503 <td>San Francisco</td>
508 <td>h.hatfield@datatables.net</td>
514 <td>San Francisco</td>
519 <td>h.fuentes@datatables.net</td>
524 <td>Financial Controller</td>
525 <td>San Francisco</td>
530 <td>v.harrell@datatables.net</td>
535 <td>Office Manager</td>
541 <td>t.mooney@datatables.net</td>
552 <td>j.bradshaw@datatables.net</td>
557 <td>Support Engineer</td>
563 <td>o.liang@datatables.net</td>
568 <td>Software Engineer</td>
574 <td>b.nash@datatables.net</td>
579 <td>Support Engineer</td>
585 <td>s.yamamoto@datatables.net</td>
596 <td>t.walton@datatables.net</td>
601 <td>Support Engineer</td>
602 <td>San Francisco</td>
607 <td>f.camacho@datatables.net</td>
612 <td>Data Coordinator</td>
618 <td>s.baldwin@datatables.net</td>
623 <td>Software Engineer</td>
629 <td>z.frank@datatables.net</td>
634 <td>Software Engineer</td>
635 <td>San Francisco</td>
640 <td>z.serrano@datatables.net</td>
645 <td>Junior Javascript Developer</td>
651 <td>j.acosta@datatables.net</td>
656 <td>Sales Assistant</td>
662 <td>c.stevens@datatables.net</td>
667 <td>Regional Director</td>
673 <td>h.butler@datatables.net</td>
678 <td>Systems Administrator</td>
684 <td>l.greer@datatables.net</td>
690 <td>San Francisco</td>
695 <td>j.alexander@datatables.net</td>
700 <td>Regional Director</td>
706 <td>s.decker@datatables.net</td>
711 <td>Javascript Developer</td>
717 <td>m.bruce@datatables.net</td>
722 <td>Customer Support</td>
728 <td>d.snider@datatables.net</td>
734 <li class="active">Javascript</li>
738 <li>Server-side script</li>
743 <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
744 // Setup - add a text input to each footer cell
745 $('#example tfoot th').each( function () {
746 var title = $('#example thead th').eq( $(this).index() ).text();
747 $(this).html( '<input type="text" placeholder="Search '+title+'" />' );
751 var table = $('#example').DataTable( {
752 scrollY: "300px",
754 scrollCollapse: true,
759 table.columns().indexes().each( function (idx) {
760 $( 'input', table.column( idx ).footer() ).on( 'keyup change', function () {
763 .search( this.value )
768 new $.fn.dataTable.FixedColumns( table );
771 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
774 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
775 <li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
776 <li><a href="../js/dataTables.fixedColumns.js">../js/dataTables.fixedColumns.js</a></li>
781 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
786 <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
787 additional CSS used is shown below:</p><code class="multiline language-css">/* Ensure that the demo table scrolls */
788 th, td { white-space: nowrap; }
789 div.dataTables_wrapper {
795 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
798 <li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
799 <li><a href="../css/dataTables.fixedColumns.css">../css/dataTables.fixedColumns.css</a></li>
804 <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
809 <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
810 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
811 documentation</a>.</p>
819 <div class="gradient"></div>
822 <h2>Other examples</h2>
825 <div class="toc-group">
826 <h3><a href="./index.html">Examples</a></h3>
827 <ul class="toc active">
828 <li><a href="./left_right_columns.html">Left and right fixed columns</a></li>
829 <li><a href="./simple.html">Basic initialisation</a></li>
830 <li><a href="./two_columns.html">Multiple fixed columns</a></li>
831 <li><a href="./right_column.html">Right column only</a></li>
832 <li><a href="./rowspan.html">Complex headers</a></li>
833 <li><a href="./colvis.html">ColVis integration</a></li>
834 <li><a href="./server-side-processing.html">Server-side processing</a></li>
835 <li><a href="./css_size.html">CSS row sizing</a></li>
836 <li><a href="./size_fixed.html">Assigned column width</a></li>
837 <li><a href="./size_fluid.html">Fluid column width</a></li>
838 <li class="active"><a href="./col_filter.html">Individual column filtering</a></li>
839 <li><a href="./bootstrap.html">Bootstrap</a></li>
840 <li><a href="./index_column.html">Index column</a></li>
845 <div class="epilogue">
846 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
847 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>
848 which extend the capabilities of DataTables.</p>
850 <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2015<br>
851 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>