jQuery column filters
<p>I have an application which presents a list of clients in a table. There are 485 rows in this table. In the <code>thead</code> there is a textbox which allows the user to filter on the value entered in the column in which the textbox appears. It seems that whenever the user enters a letter in one of these fields it takes so long that Firefox displays the prompt about the script not responding.</p>

<p>Before anyone suggests it, paging is not an option here - the idea is that it displays the full client list and then the user filters on a certain value in a certain column.</p>

<p>Currently I am using the following method to filter each column:</p>

<pre><code>$inputs.keyup(function() {
    $header = $(this).closest("th").attr("data-header-name");
    $table = $(this).closest("table").find("tbody");
    $rows = $table.find("tr");
    $rows.not(":visible").show(0);
    $input = $(this);
    if(!($.trim($input.val())) == "") {
         $rows.filter(function(i) {
             return ($(this).find("td").filter(function() {
                 return ($(this).attr("headers") == $header)
             }).html().toLowerCase().indexOf($input.val().toLowerCase()) == -1);
         }).hide(0);
    }
});
</code></pre>

<p>Does anyone have any ideas on how to improve this so that it is a lot faster? Thanks in advance.</p>

<p><a href="http://jsfiddle.net/J4ngs/7/" rel="nofollow">JS Fiddle</a></p>

<p>Regards,
Richard</p>
