HTML | DOM Table width Property Last Updated : 30 May, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The Table width property in HTML DOM is used to set or return the value of the width attribute of a table. Note: This property is not supported by HTML5. Syntax: It returns the width property of a table.tableObject.width;It is used to set the width property of a table.tableObject.width ="pixels"; Attribute Values: pixels: It sets the width of a table in terms of pixels.%: It sets the width of table in terms of percentage (%). Return Values: It returns a numeric value which represents the width of the table element. Note: It is not supported by HTML 5. Example 1: This example returns the width property of a table. html <!DOCTYPE html> <html> <head> <title> HTML DOM table width Property </title> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML DOM table width Property</h2> <table border="1" id = "gfg" width="250"> <tr> <th>NAME</th> <th>AGE</th> <th>BRANCH</th> </tr> <tr> <td>BITTU</td> <td>22</td> <td>CSE</td> </tr> </table> <br><br> <button ondblclick="thead()"> Return width </button> <p id="sudo"></p> <script> function thead() { var x = document.getElementById("gfg").width; document.getElementById("sudo").innerHTML = x; } </script> </body> </html> Before Clicking the Button: After Clicking the Button: Example 2: This example sets the width property of a table. html <!DOCTYPE html> <html> <head> <title> HTML DOM table width Property </title> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML DOM table width Property</h2> <table border="1" id = "gfg" width="250"> <tr> <th>NAME</th> <th>AGE</th> <th>BRANCH</th> </tr> <tr> <td>BITTU sehgl</td> <td>22</td> <td>CSE</td> </tr> </table> <br><br> <button ondblclick="thead()"> Return width </button> <br> <br> <p id="sudo"></p> <script> function thead() { var x = document.getElementById("gfg").width = "350"; document.getElementById("sudo").innerHTML = "The width ws set to" + x; } </script> </body> </html> Before Clicking the Button: After Clicking the Button: Supported Browsers: Google Chrome 6.0Internet Explorer 10.0Firefox 16.0Apple Safari 5.0Opera 10.6O Comment More infoAdvertise with us Next Article HTML | DOM Table width Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM HR width Property The DOM HR width Property is used to set or return the value of the width attribute of an HR Element. Note: This property is not supported by HTML5. Syntax:Â It returns an HR width Property.hrObject.width; It sets the HR width Property.hrObject.width = "pixel | %";Property Values:Â Property Value De 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 HTML DOM Table rules Property The HTML DOM Table rules property is used to set or return the value of the rules attribute of the <table> tag. The rules attribute is used to define which part of the borders should be visible. Note: This property is no longer supported in HTML5. Syntax It returns the rules property. tableObj 2 min read HTML DOM Table frame Property The HTML DOM Table frame property is used to set or return the value of the frame attribute of an <table> element. The frame attribute is used to specify the visibility of outside borders. Note: This property is not supported by HTML5 Syntax It is used to return the frame property. tableObject 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 Like