Welcome to the Treehouse Community
Looking to learn something new?
Carson Clark2,159 Points
Why won't this work?
Could somebody possibly tell me why this won't work. What exactly is a "cell"? Isn't it the same as a row? I'm missing something! Thanks.
<table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> <thead> <tr> <td>Data 1</td> <td>Data 2</td> </tr> </table>
a table cell is <td>
Catalin Sucigan15,563 Points
More specific, a table is divided into rows with the <tr> tag (as you know). A row is divided into data CELLS with the <td> tag. Too late anywayz :D
Table cells are either
<td> data cell or
<th> header cell
Your content is going to be inside those elements.
Tables have very specific rules about what elements can go where and in what order.
td's and th's must be contained within tr's. So a
<tr> element can contain zero or more
In your screenshot you have two problems. Your
<thead> can't contain
<th> children. The
<th>'s must be contained within a
Also, you have placed text directly inside the table row's in your
tbody section. The table rows need to contain table cells and then those cells can contain your text.
The spec isn't the easiest thing to read but this link contains the full rules for how these elements have to be used.
Near the beginning of each subsection you will see Contexts in which this element can be used: and Content model: These two parts tell you where to put the elements and also what can be inside them.