empty-cells

Description

The empty-cells property controls how to display borders and background on empty cells for a table in separated borders.

ItemValue
Initial value show
Inherited yes
Version CSS2
JavaScript syntax object.style.emptyCells="hide"

Syntax and Property Values


empty-cells: hide | show | inherit 

The property values are listed in the following table.

Value Description
hide empty cells will not have background or borders
show Show background and borders for empty cells. Default value
inherit Inherit the empty-cells property from the parent element

Example


<!DOCTYPE HTML>
<html>
<head>
<style>
td {<!--   w  ww . j a va  2  s.  com-->
  border: solid 1px black;
  width: 100px;
  empty-cells: hide;
}
</style>
</head>
<body>
<table>
  <tr>
    <td></td>
    <td scope="col">Race 1</td>
    <td scope="col">Race 2</td>
    <td scope="col">Race 3</td>
  </tr>
  <tr>
    <td scope="row">Driver A</td>
    <td>22m 33s</td>
    <td>18m 50s</td>
    <td>8m 45s</td>
  </tr>
  <tr>
    <td scope="row">Driver B</td>
    <td>24m 56s</td>
    <td>16m 23s</td>
    <td>8m 11s</td>
  </tr>
</table>

</body>
</html>

Click to view the demo

The code above generates the following result.

empty-cells




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference