English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Comprehensive List of CSS Properties

CSS empty-Usage and examples of cells attribute

empty-The cells CSS attribute shows or hides the border and background of table cells without visible content. Non-breaking spaces ( ) are considered visible content.

The following table explains the usage and version history of this attribute, as well as its syntax in the JavaScript script.

Default value:show
Applies to:Table cell element
Inheritance:Yes
Animatable:No.See Animation attribute.
Version:CSS 2,3
JavaScript syntax: object.style.emptyCells="hide"

Syntax for using empty cells

The syntax of this attribute is as follows:

empty-cells: show | hide | initial | inherit

The following examples demonstrate how to use empty-cells attribute.

  table {
   empty-cells: show;
  }
Test and see‹/›

Attribute value

The following table describes the value of this attribute.

ValueDescription
showDraw a border and background around empty cells like normal cells. This is the default value.
hideThere is no border or background around empty cells.
initialSet this attribute to its default value.
inheritIf specified, the associated element uses its parent element's empty-The value of the cells attribute.

Browser compatibility

empty-Browser compatibility of the cells attribute, the numbers in the following table represent the minimum version number of the browser that supports this attribute; all mainstream browsers support this attribute.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 8+

  • Apple Safari 1.2+

  • Opera 4+

Warning: Internet Explorer 7and earlier versions do not support the empty-cells attribute. IE8Supports this attribute, but requires an effective<!DOCTYPE>.

Read more

See tutorial:CSS Tables.

Related attributes:table-layout,border-collapse,border-spacing