It depends on how you need your filtration/search to work exactly, but if you just want to check if the keyword exists anywhere in the row, you can check the textContent or innerText of the row itself, no need to check for a specific column or all columns, ie
for (let i = 0; i < tr.length; i++) {
tr[i].style.display = (tr[i].innerText.toUpperCase().includes(filter)) ? 'table-row' : 'none';
}
How to modify this search to go through all columns. Right now its just going through results of the first column.
let input = document.getElementById("search_table");
let filter = input.value.toUpperCase().trim();
let table = document.getElementById("listingTable");
let tr = table.getElementsByTagName("tr");
for (let i = 0; i < tr.length; i++) {
let td = tr[i].getElementsByTagName("td")[0];
if (td) {
let txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}