HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> table, td, th{ border: 1px solid black; } table{ width: 200px; } </style> </head> <body> <h1>CSS empty-cells Property</h1> <table> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Jos</td> <td>28</td> </tr> <tr> <td>Alex</td> <td></td> </tr> </table> <button onclick="myFunction()">Click Me</button> <script> var x = document.getElementsByTagName("table")[0]; function myFunction(){ x.style.emptyCells = "hide"; } </script> <p><strong>Note</strong>: Click on the button to change the 'empty-cells' from 'show' (default) to 'hide'.</p> </body> </html>
OUTPUT
×

Save as Private