Share on Google+Share on Google+

HTML 5 tfoot Tag, Example of <tfoot> tag in html5

Advertisement
In this discussion, We will introduce about the use of <tfoot> tag in html5.

HTML 5 tfoot Tag, Example of <tfoot> tag in html5

In this discussion, We will introduce about the use of <tfoot> tag in html5. This tag is used to specify the group of footer content of the table body. In the table we must have zero or more <tr> tag inside the <tfoot> tag. The <tfoot> tag is used in conjunction with <tbody>, <thead> in the <table> tag. The <tfoot> tag must have one or more <td> tag within <tr> tag which is nested in <tfoot>. The <tfoot> tag is the child of <table> tag and used after the <caption>, <colgroup>, <thead> tag and before the <tbody> tag. This tag must have opening and closing tags.

Declaration Syntax:

the syntax of the <tfoot> tag is as:

<tfoot>One or more tr, td tag</tfoot>

This tag don't have any specific attribute.

Example: tfoot_tag.html.

<!DOCTYPE html>
<html>
   <head>
        <title>Example of tfoot tag</title>
    </head>
      <body>Example for tfoot tag.<p>
                 <table border="1">
                                  <thead>
                                      <tr>
                                           <th>NAME</th>
                                           <th>Sr. name</th>
                                       </tr>
                                  </thead>
                                  <tfoot>
                                       <tr>
                                           <td>footer1</td>
                                           <td>footer2</td>
                                       </tr>
                                 </tfoot>
                                 <tbody>
                                         <tr>
                                             <td> Gyan</td>
                                             <td>  Singh</td>
                                         </tr>
                                         <tr>
                                              <td> Ankit</td>
                                              <td> Kumar</td>
                                         </tr>
                              </tbody>
                 </table>
     </body> 
</html>

Output:

Download This Example:

Difference between html4.01 and html5.

None

Advertisements

Advertisement

Posted on: September 15, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.