CSS empty-cells
The CSS empty-cells
property specifies whether to display or hide borders on empty table cells.
Empty table cells are cells that don't contain any visible content. Visible content includes
and other whitespace except ASCII CR (\0D
), LF (\0A
), tab (\09
), and space (\20
).
Empty cells and cells with the visibility
property set to hidden
are considered to have no visible content. Cells are empty unless they contain one or more of the following:
- floating content (including empty elements),
- in-flow content (including empty elements) other than white space that has been collapsed away by the
white-space
property handling.
When the empty-cells
property is set to show
, borders are drawn around the empty cell and backgrounds are drawn behind it. When set to hide
, no borders are drawn around it and no background is drawn.
Also, if all the cells in a row have a value of hide
and have no visible content, then the row has zero height and there is vertical border-spacing on only one side of the row.
Syntax
Possible Values
show
- Borders and backgrounds are drawn around/behind empty cells (like normal cells).
hide
- No borders or backgrounds are drawn around/behind empty cells. Also, if all the cells in a row have a value of
hide
and have no visible content, then the row has zero height and there is vertical border-spacing on only one side of the row.
In addition, all CSS properties also accept the following CSS-wide keyword values as the sole component of their property value:
initial
- Represents the value specified as the property's initial value.
inherit
- Represents the computed value of the property on the element's parent.
unset
- This value acts as either
inherit
orinitial
, depending on whether the property is inherited or not. In other words, it sets all properties to their parent value if they are inheritable or to their initial value if not inheritable.
General Information
- Initial Value
show
- Applies To
table-cell
boxes- Inherited?
- Yes
- Media
- Visual
- Animation Type
- Discrete
Example Code
Official Specifications
- CSS Table Module Level 3 (W3C First Public Working Draft, 25 October 2016)
- CSS Level 2.1 (W3C Recommendation 07 June 2011)