I made a table and wanted to make it searchable, so I googled and looked here at starckoverflow.
But somehow, the things I\'ve found, that should work, dont wo
The ways posted were a little slow for my table. I came up with a different solution that seems to be much faster.
If you want to search through every cell you can add an attribute to the cell (I used data-name), ex:. Then you can use this javascript code:John Smith
$("#search").keyup(function() {
var val = this.value.trim().toLowerCase();
if ('' != val) {
var split = val.split(/\s+/);
var selector = 'td';
for(var i=0;i
If you just want to search a rows for a single attribute you can just add the attribute to the row like and use the following: John Smith ...
$("#search").keyup(function() {
var val = this.value.trim().toLowerCase();
if ('' != val) {
var split = val.split(/\s+/);
var selector = 'tr';
for(var i=0;i
Hope that helps!