Is there any way to select only innermost tables? That is ones that do not contain any more tables inside them?
I know I can filter by element.getElementsByTagName("table").length == 0, I’m just wondering if there’s a more elegant solution.
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.
With pure CSS you can’t do this. With jQuery (which your question is tagged with) you can:
will select tables with no child tables.
The
:has()selector finds elements elements that have a particular descendant.:not()inverts the selection to those that don’t have that particular descendant.