Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. empty-cells

empty-cells

Specifies how to display table cell elements that contain no visible content.

Sample Code

style.css
/* show border and background for empty cells (initial value) */
table.test { empty-cells: show;}

/* hide border and background for empty cells */
table.test1 tr td { empty-cells: hide;}

/* practical use: summary table with hidden empty cells */
table.summary { empty-cells: hide; border-collapse: collapse;}
table.summary td { border: 1px solid #ccc; padding: 8px;}

Available Values

ValueDescription
showTable cell elements with this value will display their border and background even when they contain no visible content. This is the initial value.
hideTable cell elements with this value will not display their border or background when they contain no visible content.

Browser Preview

<table style="border: solid 1px red; empty-cells: show;">
	<tr><td style="border: solid 1px blue; background-color: yellow;">This is a td element. The td below is empty.</td><td style="border: solid 1px blue; background-color: yellow;"></td></tr>
	<tr><td style="border: solid 1px blue; background-color: yellow;"></td><td style="border: solid 1px blue; background-color: yellow;">This is a td element. The td above is empty.</td></tr>
</table>

<table style="border: solid 1px red; empty-cells: hide;">
	<tr><td style="border: solid 1px blue; background-color: yellow;">This is a td element. The td below is empty.</td><td style="border: solid 1px blue; background-color: yellow;"></td></tr>
	<tr><td style="border: solid 1px blue; background-color: yellow;"></td><td style="border: solid 1px blue; background-color: yellow;">This is a td element. The td above is empty.</td></tr>
</table>

Overview

Specifies how to display table cell elements that contain no visible content. Setting the value to show will display the border and background even when the cell is empty. Setting it to hide will hide the border and background for empty cells.

When a cell is hidden, only the border and background are hidden — the cell still exists in the layout. This is the same as setting the opacity property to 0 or the visibility property to hidden.

This property can only be applied to table cell elements. Since empty-cells is inherited, you can also set it on a parent table or tr element.

Browser Compatibility

Chrome Chrome
1+
Firefox Firefox
1+
Safari Safari
1.2+
Edge Edge
12+
IE IE
11
10
9
8
7 ×
6 ×
Opera Opera
4+
3 or earlier ×
iOS Safari iOS Safari
1+
Android Android Browser
4.4+
3 or earlier ×
Chrome Android Chrome Android
Latest
Same support as desktop version
Firefox Android Firefox Android
Latest
Same support as desktop version

※ Version data based on MDN.

If you find any errors or copyright issues, please .