The CSS reference

"empty-cells" - css property (v. css 2)

  • In the separated borders model ('border-collapse' : separate), this property controls the rendering of borders and backgrounds around cells that have no visible content.
  • Empty cells and cells with the 'visibility' property set to 'hidden' are considered to have no visible content.
  • Initial value: show
  • The property is inherited
  • HTML usage: 'table-cell' elements
  • Browsers that support the empty-cells - property :
    Internet Explorer Mozilla Firefox Opera Google Chrome Apple Safari

Possible empty-cells values:

Values Comments CSS
show Borders and backgrounds are drawn around/behind empty cells.(normal cells) 2
hide No borders or backgrounds are drawn around/behind empty cells 2
inherit Will inherit the value(s) from parent specification. 2

Property "empty-cells" example:

<!DOCTYPE HTML >
<html  >
  <head>
    <title>Test</title>
    <script type="text/javascript" >
    </script>
    <style   type="text/css">
      table { height: 200px; width:300px; }
      td {empty-cells: hide;
          border: 10px green inset;}
     </style>
  </head>
  <body >
    <table  >
      <tr >
        <td >This cell is not empty </td>
        <td >This cell is not empty</td>
        <td >This cell is not empty</td>
      </tr>
      <tr >
        <td ></td>
        <td >This cell is not empty,
          but left and right cells are empty</td>
        <td ></td>
      </tr>
    </table>
  </body>
</html>

Javascript access:

// To SET values ([o] is the target object)
[o].style.emptyCells="empty-cells value"
// To GET values you must first get the computed style object
// To get that object in IE or Opera:
var cStyle=[o].currentStyle;
// To get that object in Firefox, Chrome or Safari (w3c-type):
var cStyle=window.getComputedStyle([o],null)
// To GET the property value:;
var value=cStyle.emptyCells;
© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.