title: How to create a filter search to search data from two columns in a table?
body: <p>Right now the search is searching from only first column. I have taken the code from <a href="http://www.w3schools.com/howto/howto_js_filter_table.asp" rel="nofollow noreferrer">w3schools</a> Here is the code:</p>
  
  <pre><code>function myFunction() {
  // Declare variables
    var input, filter, table, tr, td, i;
    input = document.getElementById("myInput");
    filter = input.value.toUpperCase();
    table = document.getElementById("myTable");
    tr = table.getElementsByTagName("tr");
  
    // Loop through all table rows, and hide those who don't match the search query
    for (i = 0; i &lt; tr.length; i++) {
      td = tr[i].getElementsByTagName("td")[0];
      if (td) {
        if (td.innerHTML.toUpperCase().indexOf(filter) &gt; -1) {
          tr[i].style.display = "";
        } else {
          tr[i].style.display = "none";
        }
      }
    }
  }
  </code></pre>