如何CSS选择colspan设置的所有单元格?

fre*_*ent 0 css css-selectors css3

我想选择表头中具有colspan属性集的所有单元格.

当然我可以这样做:

 table thead th[colspan="1"],
 table thead th[colspan="2"],
 table thead th[colspan="3"] {

 }
Run Code Online (Sandbox Code Playgroud)

但我正在寻找这样的东西:

 table thead th[colspan*=""] {

 }
Run Code Online (Sandbox Code Playgroud)

这似乎不起作用.

问题:
如何选择表中设置了colspan的所有单元格?

谢谢!

Ori*_*iol 9

只是用

table thead th[colspan]
Run Code Online (Sandbox Code Playgroud)

根据CSS 2.1规范,

[att]

当元素设置"att"属性时匹配,无论属性的值如何.