The column combinator (||
) is placed between two CSS selectors. It matches only those elements matched by the second selector that belong to the column elements matched by the first.
col.selected||td {
background: gray;
}
Syntax
column-selector || cell-selector {
}
HTML
<table border="1">
<colgroup>
<col span="2" />
<col class="selected" />
</colgroup>
<tbody>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td colspan="2">D</td>
<td>E</td>
</tr>
<tr>
<td>F</td>
<td colspan="2">G</td>
</tr>
</tbody>
</table>
CSS
col.selected||td {
background: gray;
color: white;
font-weight: bold;
}
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
Column_combinator |
No |
No |
No |
No |
No |
No |
No |
No |
No |
No |
No |
No |