Col 1 | Col 2 | Col 3 |
---|---|---|
Cell a1 | Cell a2 | Cell a3 |
Cell b1 | Cell b2 | Cell b3 |
Makes it easy to style <tr>
element if it contains th
elements.
(However, most of the time you can just tyle <thead>
instead.)
tr:has(th) { background-color: orange; }
tr:has(td) { background-color: gray; }
Col 1 | Col 2 | Col 3 |
---|---|---|
Cell a1 | Cell a2 | Cell a3 |
Cell b1 | Cell b2 | Cell b3 |