HTML tfoot tag

HTML <tfoot> element defines the table footer. It contains the summary or result of the columns at the end of the table.

<table class="demoTable">
  <thead>
   <tr><th>Month</th><th>Expenses</th></tr>
  </thead>
  <tbody>
   <tr> <td>March</td> <td>$25000</td> </tr>
   <tr> <td>April</td><td>$32000</td> </tr>
   <tr> <td>May</td> <td>$28000</td> </tr>
  </tbody>
  <tfoot id="design">
   <tr> <td>Total</td> <td>$85000</td> </tr>
  </tfoot>
 </table>
</>
MonthExpenses
March $25000
April$32000
May $28000
Total $85000

The blue background-color distinguishes tfoot element from the thead and tbody elements

You can see the sum up of the all the values in the last row present in the tfoot element.

Tag Uses

Specific uses of <a> tag

tfoot element takes part in making the model of the table.

Tag omission

Both tags may be omitted.

Global Attributes

All the global attributes are applicable on the tfoot element.



Was this article helpful?