HTML <tfoot> Tag

Advertisements


Description

The HTML <tfoot> tag is used in adding a footer to a table. The tfoot tag is used in conjunction with the tbody tag and the thead tag in determining each part of the table (header, footer, body).

Example

<!DOCTYPE html>
<html>
<head>
<title>HTML tfoot Tag</title>
</head>
<body>
<table style="width:100%" border="1">
<thead>
<tr>
<td colspan="4">This is the head of the table</td>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4">This is the foot of the table</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
<tr>
...more rows here containing four cells...
</tr>
</tbody>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
<tr>
...more rows here containing four cells...
</tr>
</tbody>
</table>
</body>
</html>

This will produce following result:

...more rows here containing four cells... ...more rows here containing four cells...
This is the head of the table
This is the foot of the table
Cell 1 Cell 2 Cell 3 Cell 4
Cell 1 Cell 2 Cell 3 Cell 4

Global Attributes

This tag supports all the global attributes described in - HTML Attribute Reference

Specific Attributes

The HTML <tfoot> tag also supports following additional attributes:

AttributeValueDescription
alignright
left
center
justify
char
Deprecated-Visual alignment.
charcharacterDeprecated-Specifies which character to align text on. Used when align="char"
charoffpixels or %Deprecated-Specifies an alignment offset (either in pixels or percentage value) against the first character as specified with the char attribute. Used when align="char"
valigntop
middle
bottom
baseline
Deprecated-Vertical alignment.

Event Attributes

This tag supports all the event attributes described in - HTML Events Reference

Browser Support

ChromeFirefoxIEOperaSafariAndroid
YesYesYesYesYesYes

html_tags_reference.htm