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

Tim Holley
Tim Holley
8,464 Points

Why is it that the tfoot should go in between the thead and tbody?

The video never explains why it is that the tfoot wouldn't go at the bottom?

5 Answers

Tawny Bartlett
Tawny Bartlett
24,674 Points

I think it's an unusual element in that sense. I believe it's so that the browser can render the table header and footer before it renders the table's body, in case there's a huge amount of data in there. It also makes sense I think in terms of when you're actually writing the code, it keeps the clean information together before you get lost in too many rows!

Sreng Hong
Sreng Hong
15,083 Points

This was done to allow the header and footer of a table to load first, before loading in a variable amount of body data, which would otherwise possibly block the loading of the table footer.

This was changed recently, now tfoot has to come after the tbody (source).

marcus shipman
marcus shipman
8,686 Points

Ok, Hong your answer makes since because I put the footer at the bottom between the closing table and the closing body and still got the same result.

Tim Holley
Tim Holley
8,464 Points

Makes sense,

Thanks for your quick replies.