emptyCells Property - Javascript CSS Style Property

Javascript examples for CSS Style Property:emptyCells

Description

The emptyCells property sets or gets whether to show the border and background of empty cells, or not.

Property Values

Value Description
showshow empty cells. Default
hidehide empty cells
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Technical Details

Item Value
Default Value: show
Return Value: A String, representing the border and background of empty cells
CSS VersionCSS2

Get empty cells display settings

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
table, td {
    border: 1px solid black;
    border-collapse: separate;
}
</style>//ww  w . j  ava2s  . c  o m
</head>
<body>

<table id="myTable" style="empty-cells:hide;">
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td></td>
  </tr>
</table>
<br>

<button type="button" onclick="myFunction()">Return the emptyCells property</button>

<script>
function myFunction() {
    console.log(document.getElementById("myTable").style.emptyCells);
}
</script>

</body>
</html>

Related Tutorials