CSS empty-cells Property
Description
The empty-cells property controls whether table cells that contain no meaningful content are rendered with their visual styling. In practice this means it determines if a truly empty cell should appear with the cell’s visual treatment, so authors can avoid visual gaps or extra lines where no data exists. The property only applies to table cells and affects how those cells contribute to the table’s appearance without changing layout or the document structure.
What counts as “empty” for the purposes of this property depends on whether the cell contains any content, including generated content. For example, text nodes, images and other replaced elements make a cell non-empty; likewise, content injected via the content mechanism will typically prevent a cell from being treated as empty. User-agent specifics can vary when a cell contains only invisible elements (for instance elements with certain visibility or zero dimensions), so testing is advisable if you rely on edge cases.
The visual result also interacts with other table-related properties. When table borders are being handled in collapse mode the visual outcome for empty cells can differ from the separate-borders case; see border-collapse for how border conflict resolution changes rendering. The property only applies to elements that behave as table cells (see display), and designers often use it together with cell-level visual rules such as background or border styles to produce cleaner tables. Practical uses include removing noise from tables that have plenty of structurally empty cells and ensuring decorative lines or fills aren’t shown where there’s no content — but be mindful that hiding such visuals can make tabular relationships less obvious to users, so use it in a way that preserves clarity and accessibility.
Definition
- Initial value
- show
- Applies to
- 'table-cell' elements
- Inherited
- Yes
- Computed value
- As specified
- Animatable
- No
- JavaScript syntax
- object.style.emptyCells
Interactive Demo
| Bananas | 5 Dollars |
| 10 Dollars | |
| Oranges | 2 Dollars |
| Grapes |
Syntax
empty-cells: show | hide | inherit
Values
- showRenders empty cells with inherited borders and styles.
- hideDoes not render the cell.
Example
Browser Support
The following information will show you the current browser support for the CSS empty-cells property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
