add basic table styling

This commit is contained in:
davemachado
2017-08-15 23:00:45 -04:00
parent bd6fbe4aff
commit 43780c40b5
4 changed files with 50 additions and 6 deletions
+22 -1
View File
@@ -41,4 +41,25 @@ new Vue({
return show;
}
}
}).$mount('#app');
}).$mount('#app');
function filterRows() {
// Declare variables
var input, filter, table, tr, td, i;
input = document.getElementById("searchbox");
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 < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[0];
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}