title: Search multiple tables using Datatables
body: <p>Ok, jquery amateur alert before I get started.</p>
  
  <p>I'm using <a href="http://datatables.net" rel="noreferrer">Datatables</a> and cannot seem to get the <a href="http://datatables.net/plug-ins/api#fnFilterAll" rel="noreferrer">fnFilterAll</a> API to function, even with the example given on their site.  I've exhausted an online google operation over a period of several hours last night and to my frustration I couldn't find an actual working example of the fnFilterAll.</p>
  
  <p>fnFilterAll API is to allow searching of multiple tables (for those wondering).</p>
  
  <p>To keep things simple at the moment, I created a split page with two tables.  I think I'm missing something very elementary though, like perhaps I have to specify columns, but not sure where to do so (in this.value area?).  At any rate, here's my code as a starting point:</p>
  
  <p>Any assistance greatly appreciated.  Thank you for your time.</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
  &lt;html&gt;
  
      &lt;head&gt;
          &lt;meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"&gt;
          &lt;title&gt;Testing Multi-Table Search Filter&lt;/title&gt;
          &lt;style type="text/css" title="currentStyle"&gt;
              @import"DataTables/media/css/demo_page.css";
              @import"DataTables/media/css/demo_table.css";
              #div1 {
                  background: #FFFDE0;
                  width: 49%;
                  height: 50%;
                  float: left;
              }
              #div2 {
                  background: #E2FFE0;
                  width: 49%;
                  height: 50%;
                  float: left;
              }
              #div-mid-spacer {
                  width: 2%;
                  height: auto;
                  float: left;
              }
          &lt;/style&gt;
          &lt;script type="text/javascript" language="javascript" src="DataTables/media/js/jquery.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" language="javascript" src="DataTables/media/js/jquery.dataTables.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" charset="utf-8"&gt;
              $.fn.dataTableExt.oApi.fnFilterAll = function(oSettings, sInput, iColumn, bRegex, bSmart) {
                  var settings = $.fn.dataTableSettings;
  
                  for (var i = 0; i &lt; settings.length; i++) {
                      settings[i].oInstance.fnFilter(sInput, iColumn, bRegex, bSmart);
                  }
              };
  
              $(document).ready(function() {
                  $('#table1').dataTable({
                      "bPaginate": false,
  
                  });
                  var oTable0 = $("#table1").dataTable();
  
                  $("#table1").keyup(function() {
                      // Filter on the column (the index) of this element
                      oTable0.fnFilterAll(this.value);
                  });
              });
  
              $(document).ready(function() {
                  $('#table2').dataTable({
                      "bPaginate": false,
  
                  });
                  var oTable1 = $("#table2").dataTable();
  
                  $("#table2").keyup(function() {
                      // Filter on the column (the index) of this element
                      oTable1.fnFilterAll(this.value);
                  });
              });
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div id="dt_example"&gt;
              &lt;div id="div1" style="overflow: auto;"&gt; &lt;b&gt;Current&lt;/b&gt;:
                  &lt;br&gt;
                  &lt;table class='display' id='table1'&gt;
                      &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th valign='top' width='175'&gt;Fname&lt;/th&gt;
                              &lt;th valign='top' width='100'&gt;Lname&lt;/th&gt;
                              &lt;th valign='top' width='50'&gt;Age&lt;/th&gt;
                              &lt;th valign='top' width='100'&gt;Check&lt;/th&gt;
                          &lt;/tr&gt;
                      &lt;/thead&gt;
                      &lt;tbody&gt;
                          &lt;tr&gt;
                              &lt;td&gt;John&lt;/td&gt;
                              &lt;td&gt;Smith&lt;/td&gt;
                              &lt;td&gt;44&lt;/td&gt;
                              &lt;td&gt;--&lt;/td&gt;
                          &lt;/tr&gt;
                          &lt;tr&gt;
                              &lt;td&gt;Mary&lt;/td&gt;
                              &lt;td&gt;Doe&lt;/td&gt;
                              &lt;td&gt;54&lt;/td&gt;
                              &lt;td&gt;--&lt;/td&gt;
                          &lt;/tr&gt;
                      &lt;/tbody&gt;
                  &lt;/table&gt;
              &lt;/div&gt;
              &lt;div id="div-mid-spacer"&gt;&amp;nbsp;&lt;/div&gt;
              &lt;div id="div2"&gt; &lt;b&gt;Last&lt;/b&gt;:
                  &lt;br&gt;
                  &lt;table class='display' id='table2'&gt;
                      &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th valign='top' width='175'&gt;Fname&lt;/th&gt;
                              &lt;th valign='top' width='100'&gt;Lname&lt;/th&gt;
                              &lt;th valign='top' width='50'&gt;Age&lt;/th&gt;
                              &lt;th valign='top' width='100'&gt;Check&lt;/th&gt;
                          &lt;/tr&gt;
                      &lt;/thead&gt;
                      &lt;tbody&gt;
                          &lt;tr&gt;
                              &lt;td&gt;John&lt;/td&gt;
                              &lt;td&gt;Smith&lt;/td&gt;
                              &lt;td&gt;44&lt;/td&gt;
                              &lt;td&gt;--&lt;/td&gt;
                          &lt;/tr&gt;
                          &lt;tr&gt;
                              &lt;td&gt;Mary&lt;/td&gt;
                              &lt;td&gt;Doe&lt;/td&gt;
                              &lt;td&gt;54&lt;/td&gt;
                              &lt;td&gt;--&lt;/td&gt;
                          &lt;/tr&gt;
                      &lt;/tbody&gt;
                  &lt;/table&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>