如何只选择表的第一个colgroup的第一个td?

Jit*_*yas 4 css

如何只选择第一tdcolgrouptable?如果我有table5列并使用5 colgroup

Fel*_*ing 17

table colgroup:first-child td:first-child

来自w3schools:

注意::first-child在IE中工作,<!DOCTYPE> 必须声明.

更新:

正如DisgruntledGoat正确提到的那样,td元素不是元素的后代colgroup.但第一个colgroup显然总是包括第一列所以这个

table tr td:first-child
Run Code Online (Sandbox Code Playgroud)

选择td每行中的第一行,应该这样做.