selector

Column — CSS reference

Draft column combinator relates a table column to cells belonging to it. It differs from a descendant combinator because col elements are not DOM ancestors of cells. The tested engine rejects it; explicit classes on cells provide a fallback.

Formal Syntax & Structure

css syntaxcss
col.selected || td { color: red; }

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>column</title><style>body{margin:8px;background:white;color:black;font:16px/20px sans-serif}*{box-sizing:content-box}td.selected{color:green}col.selected || td{color:red}</style><body><table><colgroup><col class="selected"><col></colgroup><tr><td id="a" class="selected">A</td><td>B</td></tr></table></body></html>
CSS Reference