The HTML <tfoot> tag is used to give a footer group of content in an HTML table. This tag is used in an HTML table with a header and body which is known as “thead” and “tbody”. <tfoot> tag is child tag of table and parent tag of <tr> and <td>. The <tfoot>
 element must have one or more <tr> tags inside.
Syntax
<tfoot>
// Table footer contents...
</tfoot>
Attributes
The attributes for the <tfoot> tag are supported by HTML4.1 only but are now deprecated in HTML5. To get the same effect use CSS to style text-align and vertical align.
align
|
Set the alignment of the text content.
|
valign
|
It is used to set the vertical alignment of text content.
|
char
|
Aligns the content in a header cell to a character.
|
charoff
|
It is used to set the number of characters aligned with the character specified by the char attribute. The value of these attributes is in numeric form.
|
Note: The <tfoot>
 tag also supports the Global Attributes and Event Attributes in HTML.
Example:Â In this example, we will see how to implement the above tag in HTML.
HTML
<!DOCTYPE html>
< html >
< body >
< center >
< h1 >GeeksforGeeks</ h1 >
< h2 >tfoot Tag</ h2 >
< table >
< thead >
< tr >
< th >Name</ th >
< th >User Id</ th >
</ tr >
</ thead >
< tbody >
< tr >
< td >Ram</ td >
< td >@ram_b</ td >
</ tr >
< tr >
< td >Shashank</ td >
< td >@shashankla</ td >
</ tr >
< tr >
< td >Rahman</ td >
< td >@rahamD</ td >
</ tr >
</ tbody >
< tfoot >
< tr >
< td >Total user</ td >
< td >4</ td >
</ tr >
</ tfoot >
</ table >
</ center >
</ body >
</ html >
|
Output:
Supported Browsers
- Google Chrome 1 and above
- Edge 12 and above
- Firefox 1 and above
- Opera 12.1 and above
- Safari 1 and above
Last Updated :
14 Dec, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...