Style emptyCells property

Definition and Usage

emptyCells Set or return whether the borders and background of empty cells are displayed.

See also:

CSS Tutorial:CSS Table

CSS Reference Manual:empty-cells property

Instance

Example 1

Change the display style of empty cells:

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

Try it yourself

Example 2

Return emptyCells property:

alert(document.getElementById("myTable").style.emptyCells);

Try it yourself

Syntax

Return emptyCells property:

object.style.emptyCells

Set emptyCells property:

object.style.emptyCells = "show|hide|initial|inherit"

Property value

Value Description
show Show borders and background in empty cells. Default.
hide Hide borders and background in empty cells.
initial Set this property to its default value. See also initial.
inherit Inherit this property from its parent element. See also inherit.

Technical details

Default value: show
Return value: A string representing the border and background of empty cells.
CSS Version: CSS2

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support