【发布时间】:2010-12-17 00:27:25
【问题描述】:
我想将背景颜色应用于 COLGROUP,但仅限于表格的 TBODY 内。给定一个典型的日历表,其结构如下:
<table>
<colgroup class="weekdays" span="5"/>
<colgroup class="weekend" span="2"/>
<thead>
<tr>
<td/><td/><td/><td/><td/>
<!-- I'd like the columns of the following two cells to be untouched. -->
<td/><td/>
</tr>
</thead>
<tbody>
<tr>
<td/><td/><td/><td/><td/>
<!-- I'd like selector to apply the style only to the columns of the following two cells -->
<td/><td/>
</tr>
...
</tbody>
</table>
是否有一个 CSS 选择器(或类似的东西)可以让我对 THEAD 和 TBODY 中的“周末”COLGROUP 应用不同的样式?
【问题讨论】:
标签: html css css-selectors