In HTML, browsers implicitly add a tbody
element within which to contain the tr
elements1, so in reality, tr
is never a child of table
.
Consequently, you have to do this instead:
table > tbody > tr > td
Of course, if you add a tbody
element yourself, you use the same selector. The spec explains when a tbody
is added implicitly otherwise:
Tag omission
A
tbody
element’s start tag may be omitted if the first thing inside thetbody
element is atr
element, and if the element is not immediately preceded by atbody thead
, ortfoot
element whose end tag has been omitted.
1 This is not the case for XHTML documents that are properly served as application/xhtml+xml
, however, given its XML roots.