Javascript DOM CSS Style emptyCells Property get

Introduction

Return the emptyCells property:

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

View in separate window

<!DOCTYPE html>
<html>
<head>
<style>
table, td {
  border: 1px solid black;
  border-collapse: separate;
}
</style>//from w  ww.j a va 2 s .co m
</head>
<body>

<table id="myTable" style="empty-cells:hide;">
  <caption id="myCaption">Monthly Salary</caption>
  <tr>  <th>Item</th>    <th>Savings</th>  </tr>
  <tr>  <td>CSS</td>     <td>$100</td>     </tr>
  <tr>  <td>HTML</td>    <td>$50</td>      </tr>
</table>
<br>

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

<p id="demo"></p>


<script>
function myFunction() {
  document.getElementById("demo").innerHTML = document.getElementById("myTable").style.emptyCells;
}
</script>

</body>
</html>



PreviousNext

Related