Style emptyCells attribute

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 attribute

Instance

Example 1

Change the display 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 attribute:

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

Try it yourself

Syntax

Return emptyCells attribute:

object.style.emptyCells

Set emptyCells attribute:

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

Attribute value

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

Technical details

Default value: show
Return value: 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