I need a css selector for first <tr>
in a <table>
.
I had searched on the internet and got some selectors like tr:first-child
table *:first-child tr:first-child, table tr:first-child
. But they do not works on my situation...
Here is a piece of HTML code which need to handle:
<table>
<thead>
<tr><th>you should chose this row</th></tr>
<tr><th>not this one</th></tr>
</thead>
<tbody>
<tr><td>not this one</td></tr>
</tbody>
</table>
<table>
<colgroup>
<col></col>
</colgroup>
<thead>
<tr><th>you should chose this row</th></tr>
<tr><th>not this one</th></tr>
</thead>
<tbody>
<tr><td>not this line</td></tr>
</tbody>
</table>
<table>
<colgroup>
<col></col>
</colgroup>
<tbody>
<tr><td>you should chose this row</td></tr>
<tr><th>not this one</th></tr>
</tbody>
</table>
(prefer a solution without javascript)