<table>
  <tr>
    <td>Foo</td><td>Bar</td>
    </tr>
  <tr>
    <td></td><td></td>
    </tr>
  </table>

tr:has(td:empty){
  background: blue;
}
td {
  padding: 0.5em;
  border: 1px solid black;
}
td:empty::before {
  content: '---';
  background: yellow;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.