CSS empty-cells

The empty-cells property controls whether borders and backgrounds are drawn around empty table cells. It only applies to table cells when borders are separated.

Syntax

empty-cells: show;
empty-cells: hide;

Example

table {
  border-collapse: separate;
  empty-cells: hide;
}

td {
  border: 1px solid #94a3b8;
  padding: 0.5rem;
}
Result:
AC

Important note

If the table uses border-collapse: collapse, empty-cells will not have the same visible effect. Tables do enjoy having one more detail to remember.

Related CSS topics