should work.
First-child is often missunderstood. It doesn´t care much about the element before the ":", it only looking "what is the first child of that element?". If it happend to be the same as before the ":", everything is fine. But if not, like in your case, nothing happens. So, in most case is more useful to write something like
table > :first-child
That wouldn´t help in your case here, but is the best way to use :first-child (or *-child in general) i think.
If you want to get the first appearance of a element, :first-type is your answer.
Update
I saw that point in another questions: If you don´t want the rows of the thead, you need to use tbody as parent element of course.
tbodytr:first-of-type
or
tbody > :first-child
Solution 3:
If the first row group in your table is either a thead or a tbody, and assuming the only children your table will have are colgroup, thead and tbody:
(If the first row group may instead be a tfoot, add the appropriate selectors to the list. Either way, you need all of them in order to cover all the bases.)
Share
Post a Comment
for "Css Selector For First Row In A Table"
Post a Comment for "Css Selector For First Row In A Table"