I would like to know how to filter table rows based on a column value. Plugins excluded, I would like to figure it out how to make this thing to work.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your question is quite vague, but the general idea would be something like this:
Here’s a working example. It first selects all table cells, then filters them based on some text, and removes the parent (which should be the
tr) of any remaining rows.If you don’t care about individual columns, you can select the
trelements and get rid of the call toparent. That will still work becausetextwill return the text of all the children of the selectedtr.Update based on comments
The above will remove the matching table rows from the DOM completely. If you want to just hide them, you can replace
removewithhide. If you then wanted to make the rows visible again you could simply do something like:Which selects all the
trelements and shows them (ones that are already visible will not be affected, so just the ones previously hidden will become visible again).