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!
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
Elizabeth Naughton374 Points
tr vs. table
In the code, you have
<tr> with the
Then you put a
<table> within that called "emailContainer". Why do you need the "bodyCell"
<tr>? Why not just the
Jason AnelloCourses Plus Student 94,610 Points
I think you meant "Why do you need the "bodyCell"
<td>?" Also, I'm assuming you're asking why not put the
<table> in the
<tr> directly. I'll update my answer if this is not correct.
It has to do with how tables are structured in the html specification that the w3c has created. There is a certain structure and set of rules that browsers are supposed to follow.
tr element is meant to be a container for
th elements. These are the only elements that should be used inside a
All of your table content should always be contained within a
th. In this case, the content happens to be another table. So that entire nested table should be contained entirely within a single
this is valid html:
<table> <tr> <td> <table> </table> </td> </tr> </table>
This is not valid:
<table> <tr> <table> </table> </tr> </table>