Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Tables Structuring Tables The Table Foot Element

Byron Farrell
Byron Farrell
5,700 Points

Why does the tfooter come after the rthead?

Hi,

I was curious about this so I found a forum on it: https://teamtreehouse.com/community/why-is-it-that-the-tfoot-should-go-in-between-the-thead-and-tbody. The last comment says that this has been changed with a link to a website. I'm new to html is the website legit and must tfoot be placed after tbody now?

2 Answers

Hi Byron,

The reason is so that browsers (user agents) can render the footer before receiving all of the body data. For example, if the body had 10,000 rows, it may take a long time to render.

This is why the footer follows the header. See w3 specification for correct syntax.

Jordan Adedeji
Jordan Adedeji
6,977 Points

I think this has changed now. The tfooter now comes after the tbody. Link below: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot

Douglas Carvalho
Douglas Carvalho
5,056 Points

I think mozilla website is not following the current w3c recommendations. So far, W3C still says to keep tfoot after thead and before tbody.

https://www.w3.org/wiki/Html/Elements/tfoot