Tables

empty-cells

empty-cells sets whether the borders and background of empty table cells are drawn.

Syntax

show | hide

Preview

果物の数
個数
りんご3
みかん5
Presets
Drag the bottom-right corner to resize

Code

.box {
  border-spacing: 0.25em;
  empty-cells: hide;
}

Controls

empty-cellshide
empty-cells
果物の数
個数
りんご3
みかん5

About

Values

  • show: draws borders and backgrounds on empty cells too. This is the initial value.
  • hide: draws no borders or backgrounds on empty cells.

Things to watch

  • It has no effect with border-collapse: collapse, because borders are merged with the neighboring cells.
  • An empty cell has no content at all, or only white space that white-space handling removes.   is not removed, so a cell holding only that is not empty.
  • It is inherited, so writing it on the table element applies it to every cell.

The preview leaves the top-left cell of the table inside the box empty and lets the table take the value written on the box. A supporting declaration spaces the cells apart, so hide removes only the top-left frame.

Comments