If I have a table layout like so:
<table>
<tr class="one">
<td>
...
</td>
</tr>
<tr class="two">
<td>
...
</td>
</tr>
<tr class="three">
<td>
...
</td>
</tr>
<tr class="four">
<td>
...
</td>
</tr>
</table>
What is the easiest way to find the first showing row? I say this as some of the rows classes may have “display: none” set as part of a filtering process.
I thought that:
tr:first-child
Would work but it turns out it doesn’t when hiding rows!
If you can use
jQueryit’s simply:You can’t do it without javascript.
If speed is very important to you, this is a bit faster:
Docs: