我有一些表是這樣的:CSS選擇rowgroup元素,但不是非rowgroup元素
<tr>
<th scope="rowgroup" rowspan="2">Rowgroup</th>
<th scope="row">Row 1</th>
<td>A</td>
</tr>
<tr>
<th scope="row">Row 2</th>
<td>B</td>
</tr>
我想一般的CSS規則來捕獲所有範圍=「行」的元素時,rowgroup的一部分,但未時,他們沒有這樣的rowgroup的一部分:
<tr>
<th scope="row">Row 1</th>
<td>A</td>
</tr>
<tr>
<th scope="row">Row 2</th>
<td>B</td>
</tr>
我的目標是讓所有我的TH的一種顏色,除rowgroup當一部分。我試過,但它只能轉換第一個:
th[scope="rowgroup"] th { color: blue; }
我不關心瀏覽器的兼容性和使用許多規則是好的,我只是想避免使用ID或類選擇,或者如果可能的JavaScript。
小提琴與玩:http://jsfiddle.net/H4Hy9/ – kapa