HTML DOM Table Header align Property Last Updated : 23 Aug, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The HTML DOM TableHeader align property is used to set or return the horizontal alignment of the content inside the table header. It is not supported by HTML 5. Syntax: It returns the align property.TableHeaderobject.alignIt sets the align property.TableHeaderObject.align = "left|right|center|justify|char" Property values: left: It sets the text left-aligned.right: It sets the text right-aligned.center: It sets the text center-aligned.justify: It stretches the text of the paragraph to set the width of all lines equal.char: It sets the text-align to a specific character. Return Value : It returns a string value which represents the horizontal alignment of the <th> element. Example 1: Below code illustrates how to return the TableHeader align property. HTML <!DOCTYPE html> <html> <head> <!-- Style to set border --> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <center> <h1>GeeksforGeeks</h1> <h2> DOM TableHeader align Property </h2> <table> <tr> <th id="table" style="padding:15px" align="left"> Username </th> </tr> <tr> <td>Manas Chhabra</td> </tr> </table> <br> <button onclick="clickbtn()"> Click Here! </button> <p id="paraID" style="font-size:25px;color:green"></p> <!-- Script to return the Table Header align Property --> <script> function clickbtn() { var tab = document.getElementById( "table").align; document.getElementById("paraID") .innerHTML = tab; } </script> </center> </body> </html> Output: Example 2: Below code illustrates how to set the TableHeader align property. HTML <!DOCTYPE html> <html> <head> <!-- Style to set border --> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <center> <h1>GeeksforGeeks</h1> <h2> DOM TableHeader align Property </h2> <table> <tr> <th id="table" style="padding:15px" align="left"> Username </th> </tr> <tr> <td>Manas Chhabra</td> </tr> </table> <br> <button onclick="click1()"> Click Here! </button> <p id="paraID" style= "font-size:25px;color:green"> </p> </center> <!-- script to set the Table Header align Property --> <script> function click1() { var tab = document.getElementById( "table").align = "right"; document.getElementById("sudo") .innerHTML = tab; } </script> </body> </html> Output: Supported Browsers: Google ChromeFirefoxMicrosoft EdgeOperaSafariInternet Explorer Comment More infoAdvertise with us Next Article HTML DOM Table Header align Property M manaschhabra2 Follow Improve Article Tags : HTML HTML-DOM HTML-Property Similar Reads HTML DOM TableData headers Property The HTML | DOM TableData headers Property sets or return the value of a headers attribute. The headers attribute is used to specify the table cell containing Header information for the current data cell. Syntax: // To get the header's property. let hadersProperty = tabledataObject.headers;// To set 2 min read HTML | DOM TableRow align Property The HTML DOM TableRow align Property is used to set or return the horizontal alignment of the content within the table row. It is not supported by HTML 5. Syntax: It returns the align property. TableRowobject.align It sets the align property. TableRowObject.align = "left | right | center | justify | 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 Header vAlign Property The HTML DOM TableHeader vAlign property is used to set or return the value of the vAlign attribute of the <th> element. The vAlign attribute is used to specify the vertical alignment of the text-content inside the Table Header. Note: This property is no longer supported in HTML5. Syntax: It r 2 min read HTML DOM TableHeader headers Property The HTML DOM TableHeader headers property is used to set or return the value of the headers attribute. The headerâs attribute is used to specify the table cell containing header information for the current header cell. Syntax It returns the header's property.tableheaderObject.headersIt is used to se 2 min read Like