如何只选择表的第一个colgroup的第一个td?如果我有5列的表并使用5 colgroup?解决方法 table colgroup:first-child td:first-child 从w3
... . . 如何只选择表的第一个colgroup的第一个td?如果我有5列的表并使用5 colgroup?.
解决方法
. table colgroup:first-child td:first-child
从w3schools开始:
.
Note: For :first-child
to work in IE a <!DOCTYPE>
must be declared.
更新:
正如DisgruntledGoat正确提到的那样,td元素不是colgroup元素的后代.但是第一个colgroup显然总是包含第一列所以这个
table tr td:first-child
选择每行中的第一个td应该这样做.
. . .. ...