HTML | DOM Style emptyCells Property Last Updated : 11 Jul, 2025 Comments Improve Suggest changes 1 Likes Like Report Sometimes HTML tables contain empty cells. The DOM Style emptyCells is used to display borders and background for the empty cells. Syntax: It is used to return the emptyCells property.object.style.emptyCellsIt is used to set emptyCells property.object.style.emptyCells = "show|hide|initial|inherit" Return Value:A string representing the border and background of empty cells. Property Values: show: It means that the borders and background on empty cells will be shown. It is the default value of this property.hide: It means that the borders and background on empty cells won't be shown.initial: It makes the property use its default value (i.e. show).inherit: It inherits the property from its parents element. Example-1: The following code shows how to set the emptyCells property between the show and hide. html <!DOCTYPE html> <html> <head> <title> DOM Style emptyCells Property </title> </head> <body> <center> <h1>GeeksforGeeks</h1> <h2>DOM Style emptyCells Property</h2> <table id="a1" border="1"> <tr> <th>Student Name</th> <th>Age</th> </tr> <tr> <td>Manas Chhabra</td> <td>19</td> </tr> <tr> <td>Hritik Bhatnagar</td> <td></td> </tr> </table> <br> <button type="button" onclick="hide()"> Hide empty cells </button> <button type="button" onclick="show()"> Show empty cells </button> <!-- script to show or hide emptyCell border --> <script> function hide() { document.getElementById("a1").style.emptyCells = "hide"; } function show() { document.getElementById("a1").style.emptyCells = "show"; } </script> </center> </body> </html> Output: Before click on Hide button: After clicking Hide button: Example-2: The following code shows how to get the emptyCells property. html <!DOCTYPE html> <html> <head> <title> DOM Style emptyCells Property </title> </head> <body> <center> <h1>GeeksforGeeks</h1> <h2>DOM Style emptyCells Property</h2> <table id="a1" border="1" style="empty-cells:hide;"> <tr> <td></td> <td>$</td> </tr> <tr> <td>@</td> <td></td> </tr> </table> <button type="button" onclick="myFunction()"> test </button> </center> <script> function myFunction() { console.log(document.getElementById("a1" ).style.emptyCells); } </script> </body> </html> Output: Before clicking Test button: After clicking Test button: Supported Browsers: The browser supported by DOM Style emptyCells Property are listed below: Google Chrome 1.0 and aboveEdge 12.0 and aboveInternet Explorer 8.0 and aboveFirefox 1.0 and aboveOpera 4.0 and aboveApple Safari 1.2 and above Create Quiz Comment A AlieaRizvi Follow 1 Improve A AlieaRizvi Follow 1 Improve Article Tags : JavaScript Explore JavaScript BasicsIntroduction to JavaScript4 min readVariables and Datatypes in JavaScript6 min readJavaScript Operators5 min readControl Statements in JavaScript4 min readArray & StringJavaScript Arrays7 min readJavaScript Array Methods7 min readJavaScript Strings5 min readJavaScript String Methods9 min readFunction & ObjectFunctions in JavaScript5 min readJavaScript Function Expression3 min readFunction Overloading in JavaScript4 min readObjects in JavaScript4 min readJavaScript Object Constructors4 min readOOPObject Oriented Programming in JavaScript3 min readClasses and Objects in JavaScript4 min readWhat Are Access Modifiers In JavaScript ?5 min readJavaScript Constructor Method7 min readAsynchronous JavaScriptAsynchronous JavaScript2 min readJavaScript Callbacks4 min readJavaScript Promise4 min readEvent Loop in JavaScript4 min readAsync and Await in JavaScript2 min readException HandlingJavascript Error and Exceptional Handling6 min readJavaScript Errors Throw and Try to Catch2 min readHow to create custom errors in JavaScript ?2 min readJavaScript TypeError - Invalid Array.prototype.sort argument1 min readDOMHTML DOM (Document Object Model)8 min readHow to select DOM Elements in JavaScript ?3 min readJavaScript Custom Events4 min readJavaScript addEventListener() with Examples9 min readAdvanced TopicsClosure in JavaScript4 min readJavaScript Hoisting6 min readScope of Variables in JavaScript3 min readJavaScript Higher Order Functions7 min readDebugging in JavaScript4 min read Like