CSS2 » Properties » empty-cells

Version: Level 2

Compability: Netscape 6.1+, but not IE 5+

Syntax:
empty-cells : hide | show
show
The show value dictates that a border will appear around empty cells.
hide
The hide value dictates that a border will not appear around empty cells.

The empty-cells property determines whether a border will appear around any empty cells in a table. An empty cell has no visible content. This only applies to tables using the separate border model. This property is inherited.

(While this property is currently not supported, by default, both Explorer and Netscape do not render an internal border around an empty cell.)
 
A cell that has the visibility property set to the hidden value is considered to not have visible content. Also, the carriage return, line feed, tab, and space are not considered to be visible content. An   is visible content.
 
This is one of five Level 2 properties that specifically apply style to tables. The other four are border-collapse, border-spacing, caption-side, and table-layout.
 
In the separate model, the table has a separate outer border and each individual cell has its own separate internal border. The table outer border does not physically touch the individual internal cell borders.
 

Cell 1Cell 2
Cell 4

Remember that a border is optional in a table and that the default is no border.

Examples

Code:
<table style="border-collapse: separate; empty-cells: hide;">
<tr><td>Cell 1</td><td>Cell 2</td></tr>
<tr><td></td><td>Cell 4</td></tr>
</table>

Language(s): CSS2

See Also: