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 headers and footers

The video I'm referring to is: http://teamtreehouse.com/library/websites/html/tables/headers-and-footers @minute 01:41

Why the author in the video about table headers and footers put the tfoot element under the thead directly? and why didn't he use the tbody as well?

3 Answers

Derek Hanson
Derek Hanson
7,838 Points

The tfoot does seem to be an illogical use since in HTML coding your head followed by a body then the footer come into place. However, what the footer allows to print the footer first in the browser before the rest of the information is displayed. There may be some context that for search engine purposes you want to load this first (I'm not sure what it is but I guess there are reasons. More importantly by it being set this way browsers are program to make this information scroll-able which makes it more user friendly.. Also if you have large tableture data and if someone wants or needs to print that information then they are able to have both the header and the footer to show at the end of each page rather than receiving the footer as the last part of page. If you write a table you will see that the footer does still appear at the end of the page.

I agree it seems a little illogical but a group of people have agreed on internet standards have agreed that this is the best way to render the information.

Thanks, But did the author miss tbody element in the video?

Derek Hanson
Derek Hanson
7,838 Points

It wasn't included in that video. It is titled Headers and Footers. Not sure why they didn't include that information. Tables to some level are not a major component in website design and development. Probably good to include a tbody but not absolutely necessary.

Thanks, I'll hope we will have a clarification from Nick Pettit why didn't he use or mention tbody.

Still waiting for a clarification from Nick Pettit. : )