How to create clickable button table cell show hide cells

Learn How to create clickable button table cells"show" or "hide" empty order with HTML JAVASCRIPT  code ar3school


table, td {
  border: 1px solid black;
  margin: 15px;

<p>Click the button to "hide" or "show" empty table-cells:</p>

<button type="button" onclick="hide()">Hide empty cells</button>
<button type="button" onclick="show()">Show empty cells</button>

<table id="myTable">

<p><b>Note:</b> Internet Explorer 8 supports the empty-cells property only if a !DOCTYPE is specified.</p>

function hide() {
  document.getElementById("myTable").style.emptyCells = "hide";

function show() {
  document.getElementById("myTable").style.emptyCells = "show";


Try this code from here

Comments :

Post a Comment