Skip to content
Related Articles

Related Articles

Improve Article

HTML tfoot Tag

  • Difficulty Level : Basic
  • Last Updated : 28 Jun, 2021
Geek Week

The <tfoot> tag in HTML is used to give footer group of content. This tag is used in HTML table with header and body which is known as “thead” and “tbody”. <tfoot> tag is child tag of table and parent tag of <tr> and <td>.

Syntax: 

<tfoot> // Table footer contents... </tfoot>

Attributes: The <tfoot> tag contains many attributes which are supported by HTML4.1 but not supported by HTML5. 

  • 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 sets the number of characters that will be aligned from the character specified by the char attribute. The value of these attributes is in numeric form.

Example: 

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 tag starts from here -->
            <tfoot>
                <tr>
                    <td>Total user</td>
                    <td>4</td>
                </tr>
            </tfoot>
            <!-- tfoot tag ends here -->
             
        </table>
        </center>
    </body>
   
</html>                   

Output: 
 



Supported Browsers: 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :