empty-cells

Browser Internet Explorer Netscape Opera Safari Firefox
Version 5.5 6.0 7.0 8.0 8.0 9.0 7.0 8.0 9.2 9.5 1.3 2.0 3.1 1.5 2.0 3.0
Supported No No No ? Errors Errors Errors Errors Errors Yes Yes Yes Yes Errors Errors Yes
Short information
CSS CSS2
Default value show
Inherited Yes
Applied To <TD>, <TH> or to elements having "display: table-cell"
HTML analog No
Reference to specification http://www.w3.org/TR/CSS21/tables.html#propdef-empty-cells
Description
This parameter specifies display of borders and background in a cell, if it has not visible maintenance. When there is simultaneous addition to the parameter table border-collapse with value collapse, the attribute empty-cells is ignored.
The cell is considered empty in following cases:
• There are no symbols generally;
• There are line translation, a tabulation symbol or a blank in a cell;
• Value visibility is determined as hidden.
The addition of an indissoluble blank В  is perceived as the visible maintenance, i.e. the cell will be nonempty already.

Syntax

empty-cells: show | hide
Arguments
show
It displays border round a cell and a background locating inside of it.
hide
The border and background are not displayed in empty cells. If all cells in a line are empty, the line hides entirely.

Example

 
<!--
   TABLE {
    border: 4px double #399; /* Border around the table */
   }
   TD {
    background: #fc0; /* Background color */
    border: 1px solid #333; /* Border around cells */
    empty-cells: hide; /* Hide empty cells */
    padding: 5px; /* Areas in cells */ 
   }
 
-->
<table width="100%">
<tbody>
<tr>
<td>Leonardo</td>
<td>5</td>
<td>8</td>
</tr>
<tr>
<td>Rafael</td>
<td></td>
<td>11</td>
</tr>
<tr>
<td>Micalandgelo</td>
<td>24</td>
<td></td>
</tr>
<tr>
<td>Donatello</td>
<td></td>
<td>13</td>
</tr>
</tbody>
</table>
The result of this example is shown on the figure 1

Browsers
Internet Explorer doesn't support the parameter "empty-cells" and always images empty cells like if it would be set "empty-cells: hide".
Firefox version 2 and before (and also Netscape) doesn't hide the table row even if it is set "empty-cells: hide" for all cells and all cells are empty.
Browser Opera doesn't hide the table row and images the background color for empty cells