I have:
var rows = $table.find('tbody > tr').get();
This selects all rows. However, not all tables have thead and tbody explicitly defined, so I need to filter out any rows that have .children(‘th’)
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.
EDIT: I’m assuming you wanted to filter out the rows that have
<th>elements. If you wanted to end up with only those rows, then just get rid of the:not()part.This will give you
<tr>elements in the table that do not have a descendant<th>.Note that this will also give consideration to nested tables. If there will be nested tables with
<th>tags, try this:…which should limit the consideration of the
<th>tags to immediate children.