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

Table Footer

Why should we place the "tfoot" tag immediately after the "thead" tag. Is there any reason or it is just a best practice.

2 Answers

Steven Parker
Steven Parker
229,732 Points

It's a usage restriction of the tag, at least in HTML4. According to the definition:

The <tfoot> tag must be used ... after any <thead> elements and before any <tbody> and <tr> elements.

MDN says that this restriction has been softened in HTML5. Now "It can be before or after all <tbody> and <tr> elements, but not intermixed with them." So perhaps now it is just a common practice left over from HTML4, and a way to help maintain compatibility with older software.

Thanks Steve