Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can a <tfoot> go at the bottom of a table?

Tags:

html

css

xhtml

I'd like to use a <tfoot> tag in a table to be semantically correct, but it keeps showing up at the the top of my table. Is there a way to tell it to display at the bottom?

like image 878
bloudermilk Avatar asked Jan 13 '10 02:01

bloudermilk


People also ask

How do you use a Tfoot table?

The <tfoot> tag is used to group footer content in an HTML table. The <tfoot> element is used in conjunction with the <thead> and <tbody> elements to specify each part of a table (footer, header, body). Browsers can use these elements to enable scrolling of the table body independently of the header and footer.

How do you put a table at the bottom in HTML?

To place an item at the top or bottom of its cell, insert the "VALIGN=" attribute within the code for that cell. To vertically align an entire row (e.g., placing all data in that row at the tops of the cells), insert the "VALIGN=" attribute within the code for that row.

What is Tfoot?

<tfoot>: The Table Foot element. The <tfoot> HTML element defines a set of rows summarizing the columns of the table.


1 Answers

As others have said, tfoot is defined before the tbody but rendered afterwards. This is by design and doesn't change the semantics (a table has a head, a foot and a body - the order of these doesn't matter)

The reason it's done this way is so that the foot can be loaded and displayed on screen while the body is still downloading, so you can still read the summary information you have in the foot. It's virtually moot these days, but with a slow connection and a massive table, you might still see the benefits.

like image 171
nickf Avatar answered Sep 22 '22 18:09

nickf