HTML DOM Table cellSpacing Property Last Updated : 04 Jan, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The HTML DOM Table cellSpacing Property is used to set or return the value of the cellSpacing attribute of an <table> element. The cellSpacing attribute is used to define the spaces between the cells. Note: This property is no longer supported in HTML5. Syntax It returns the cellSpacing Property. TableObject.cellSpacingIt is used to sets the cellSpacing Property. TableObject.cellSpacing = "pixels" Property Values: It contains the numeric value which represents the number of spaces between the two cells in terms of pixels. Return Value : It returns a numeric value that represents the space between the cells in terms of pixel. Example 1: Below code returns the Table cellSpacing Property. HTML <!DOCTYPE html> <html> <head> <title> Table cellSpacing Property in HTML </title> <style> table, td { border: 1px solid green; } h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>Table cellSpacing Property</h2> <table id="GFG" align="center" cellspacing="20"> <thead> <tr> <th>Subject</th> <th>Courses</th> </tr> </thead> <tr> <td>Java</td> <td>Fork Java</td> </tr> <tr> <td>Python</td> <td>Fork Python</td> </tr> <tr> <td>Placements</td> <td>Sudo Placement</td> </tr> </table> <br /> <button ondblclick="Table_Caption()"> Return CellPadding </button> <p id="sudo"></p> <script> function Table_Caption() { var w = document.getElementById( "GFG").cellSpacing; document.getElementById( "sudo").innerHTML = w + "PX"; } </script> </body> </html> Output: Example 2: Below HTML code illustrates how to set the cellSpacing Property. HTML <!DOCTYPE html> <html> <head> <title> Table cellSpacing Property in HTML </title> <style> table, td { border: 1px solid green; } h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>Table cellSpacing Property</h2> <table id="GFG" align="center" cellspacing="20"> <thead> <tr> <th>Subject</th> <th>Courses</th> </tr> </thead> <tr> <td>Java</td> <td>Fork Java</td> </tr> <tr> <td>Python</td> <td>Fork Python</td> </tr> <tr> <td>Placements</td> <td>Sudo Placement</td> </tr> </table> <br /> <button ondblclick="Table_Caption()"> Return CellPadding </button> <p id="sudo"></p> <script> function Table_Caption() { // Pixel set var w = (document.getElementById( "GFG").cellSpacing = "5"); document.getElementById( "sudo").innerHTML = w + "PX"; } </script> </body> </html> Output: Supported Browsers: Google ChromeFirefoxApple SafariInternet ExplorerOpera Comment More infoAdvertise with us Next Article HTML DOM Table cellSpacing Property M manaschhabra2 Follow Improve Article Tags : HTML HTML-DOM HTML-Property Similar Reads HTML DOM Table cellPadding Property The HTML DOM Table cellPadding property is used to set or return the value of the cellpadding attribute of the <table> element . The cellPadding attribute is used to define the space between the cell content and cell wall. Syntax: It is used to return the table cellPadding property. TableObjec 2 min read HTML | DOM TableData colSpan Property The Dom TableData colSpan Property in HTML DOM is used to set or return the value of a colspan attribute. The colspan attribute is used to specify the number of columns a table should span. Syntax: It returns the colSpan property. tabledataObject.colSpanIt is used to set the colSpan property. tabled 2 min read HTML | DOM Style borderSpacing Property The DOM Style borderSpacing Property is used to set or return the spacing between the cells in a table. Syntax: To get the borderSpacing propertyobject.style.borderSpacingTo set the borderSpacing propertyobject.style.borderSpacing = "length | initial | inherit" Return Values: It returns a string val 3 min read HTML DOM TableHeader colSpan Property The HTML DOM TableHeader colSpan property is used to set or return the value of the colspan attribute. The colspan attribute defines the number of columns that a header cell should span. Syntax: It returns the colSpan property.tableheaderObject.colSpanIt is used to set the colSpan property.tablehead 2 min read HTML DOM TableData align Property The HTML DOM TableData align property is used to set or return the horizontal alignment of the content within the table cell. It is not supported by HTML5. Syntax: It returns the align property.TableDataobject.alignIt sets the align property.TableDataObject.align = "left | right | center | justify | 2 min read Like