I've created a fixed left column table and want to incorporate a search that will show the specific column not row.
So far, I've only found this which displays the row: How to perform a real time search and filter on a HTML table
But since my headers are in the column, this approach doesn't work very well.
BTW, am pretty much a javascript noob, so bear with me.. :p
Do check out my codepen which shows what I'm trying to do. http://codepen.io/genemiester/pen/qZrpgZ
var $rows = $('#table tr');
$('#search').keyup(function() {
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
$rows.show().filter(function() {
var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
return !~text.indexOf(val);
}).hide();
});
Hope this is clear? Thanks in advance for any help!