HTML DOM TFoot align Property
Last Updated :
25 Feb, 2022
The HTML DOM TFoot align Property is used to set or return the horizontal alignment of the content within the <thead> element. It is not supported by HTML 5.
Syntax:
tfootObject.align = "left | right | center | justify | char"
Property Values
- left: It sets the text left-align.
- right: It sets the text right-align.
- center: It sets the text center-align.
- justify: It stretches the text of 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 that represents the horizontal alignment of the <tfoot> element.
Example 1: Below HTML Code illustrates how to return the TFoot align Property.
HTML
<!DOCTYPE html>
< html >
< head >
< style >
table,
th,
td {
border: 1px solid green;
}
</ style >
</ head >
< body >
< center >
< h1 >
GeeksforGeeks
</ h1 >
< p >< b >HTML DOM TFoot align Property </ b ></ p >
< table >
< thead >
< tr >
< td >Username</ td >
< td >User_Id</ td >
</ tr >
</ thead >
< tbody >
< tr >
< td >Shashank</ td >
< td >@shashankla</ td >
</ tr >
< tfoot id = "GFG" align = "left" >
< tr >
< td >GeeksforGeeks</ td >
< td >@geeks</ td >
</ tr >
</ tfoot >
</ tbody >
</ table >
< button onclick = "btnclick()" > Click here </ button >
< p id = "paraID" ></ p >
</ center >
< script >
function btnclick() {
var x = document.getElementById("GFG").align;
document.getElementById("paraID").innerHTML = x;
}
</ script >
</ body >
</ html >
|
Output:
Example 2: Below HTML code illustrates how to set the TFoot align Property.
HTML
<!DOCTYPE html>
< html >
< head >
< style >
table,
th,
td {
border: 1px solid green;
}
</ style >
</ head >
< body >
< center >
< h1 >
GeeksforGeeks
</ h1 >
< p >< b >HTML DOM TFoot align Property </ b ></ p >
< table >
< thead >
< tr >
< td >Username</ td >
< td >User_Id</ td >
</ tr >
</ thead >
< tbody >
< tr >
< td >Shashank</ td >
< td >@shashankla</ td >
</ tr >
< tfoot id = "GFG" align = "left" >
< tr >
< td >GeeksforGeeks</ td >
< td >@geeks</ td >
</ tr >
</ tfoot >
</ tbody >
</ table >
< button onclick = "btnclick()" > Click here </ button >
< p id = "paraID" ></ p >
< script >
function btnclick() {
var x = document.getElementById("GFG").align = "right";
document.getElementById("paraID").innerHTML = x;
}
</ script >
</ body >
</ html >
|
Output:
Share your thoughts in the comments
Please Login to comment...