I have the following table:
table { border-collapse: collapse; } tr:not(.header) td:not(.empty) { background: #eee; width: 100px; padding: 5px; } td.empty { width: 25px; background: white; border-right: 1px solid red; } tbody tr.header + tr td:not(.empty){ border-top: 1px solid red; } <table> <tbody> <tr class="header"> <td colspan="3">HEADER</td> </tr> <tr> <td class="empty"> </td> <td>cell</td> <td>cell</td> </tr> <tr class="header"> <td colspan="3">HEADER</td> </tr> <tr> <td class="empty"> </td> <td>cell</td> <td>cell</td> </tr> <tr> <td class="empty"> </td> <td>cell</td> <td>cell</td> </tr> <tr> <td class="empty"> </td> <td>cell</td> <td>cell</td> </tr> <tr class="header"> <td colspan="3">HEADER</td> </tr> <tr> <td class="empty"> </td> <td>cell</td> <td>cell</td> </tr> <tr> <td class="empty"> </td> <td>cell</td> <td>cell</td> </tr> </tbody> </table> The markup is generated by the Kendo framework. I am using Kendo Grids with the groupable feature enabled (http://demos.telerik.com/kendo-ui/grid/api). I cannot edit the markup provided.
And I am trying to put the same red border on the bottom of the gray areas, but I'm not sure I'm going to be able to in pure CSS. I was messing around with the adjacent/general sibling selectors, but no luck.
Here's what the table should look like:

Is there any way (in pure CSS) to give a red border to the bottom of the gray areas?
thor similar. It's no wonder it's hard to find a solution. I suggest taking all your header/cell group pairs and wrapping them intbodys. It's valid markup to do so and with that you could usingtr + trsyntax or:last-child.