Style emptyCells Property

Style Object Reference Style Object


Change how empty cells are shown:

function show() {
    document.getElementById("myTable").style.emptyCells = "show";

function hide() {
    document.getElementById("myTable").style.emptyCells = "hide";

Try it yourself »

Definition and Usage

The emptyCells property sets or returns whether to show the border and background of empty cells, or not.

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The emptyCells property is supported in all major browsers.

Note: The default value is different in different browsers. In IE, Chrome and Safari, the default value is "show", while in Firefox and Opera the default value is "hide".

Note: The emptyCells property is not supported in IE7 and earlier. IE8 requires a !DOCTYPE. IE9 supports it.


Return the emptyCells property:

Set the emptyCells property:"show|hide|initial|inherit"

Property Values

Value Description
show Border and background are shown in empty cells. This is default
hide Border and background are hidden in empty cells
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: show
Return Value: A String, representing the border and background of empty cells
CSS Version CSS2

More Examples


Return the emptyCells property:


Try it yourself »

Related Pages

CSS tutorial: CSS Table

CSS reference: empty-cells property

Style Object Reference Style Object