export const tableSearch = (word, tableRef) => {
  // Declare variables
  let table, tr, i, txtValue;
  word = word.toUpperCase();
  table = document.querySelector("." + tableRef);
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the search query
  for (i = 1; i < tr.length; i++) {
    if (tr[i]) {
      txtValue = tr[i].innerHTML;
      if (txtValue.toUpperCase().indexOf(word) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
};
