Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
This Table sections (thead, tbody, caption) worksheet is part of the HTML and CSS Journey journey. Print it as a booklet?
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1<table> <caption>Monthly Sales</caption> <tbody><tr><td>Jan</td></tr></tbody> </table> | A<thead> groups the column header row and <tbody> groups the data rows - both improve structure and accessibility | |
| 2<table> <thead><tr><th>Name</th></tr></thead> <tbody><tr><td>Alice</td></tr></tbody> </table> | B<caption> gives the table a visible title - 'Monthly Sales' appears above the table by default | |
| 3<caption> provides a visible title placed directly inside <table> | C<td> cells must be inside <tr> rows inside <tbody> - not directly inside <table> | |
| 4<thead> groups header rows and <tbody> groups data rows - both sit directly inside <table> | D<table> <caption>Class Results</caption> <tbody><tr><td>Alice</td></tr></tbody> </table> | |
| 5<table> <THEAD><tr><th>Name</th></tr></THEAD> <tbody><tr><td>Alice</td></tr></tbody> </table> | ETag names must be lowercase - <THEAD> and </THEAD> should be <thead> and </thead> | |
| 6<table> <td>Alice</td> <td>95</td> </table> | F<table> <thead><tr><th>Score</th></tr></thead> <tbody><tr><td>95</td></tr></tbody> </table> |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
<tbody> — The HTML element that groups the main data rows of a table. It sits inside <table> alongside <thead> and <caption>, wrapping the <tr> rows that contain <td> cells.<table>
<thead>
<tr><th>Name</th></tr>
</thead>
</table><table>
<tbody>
<tr><td>Alice</td></tr>
</tbody>
</table><table>
<caption>Monthly Sales</caption>
<tbody><tr><td>Jan</td></tr></tbody>
</table><table>
<thead>
<tr><th>Score</th></tr>
</thead>
</table><table>
<caption>Results</caption>
<thead><tr><th>Name</th></tr></thead>
<tbody><tr><td>Alice</td></tr></tbody>
</table>