Answer the question
In order to leave comments, you need to log in
How to filter a table?
Hey! I need to filter the table by 2 columns : I
use the following code:
var filter = $("#filter"); // < -- это Input
filter.keyup(function(e)
{
$('#main_table td:nth-child(1)').each(function()
{
if(filter.val() != $(this).text().substr(0, filter.val().length))
{
$(this).parent().hide();
} else {
$(this).parent().show();
}
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question