Starlit Daily

📚 › HTML: build the structure of a web page

8. Tables: rows, cells and headers

A table shows data in rows and columns. table wraps everything. tr is a row, th is a header cell, and td is a normal cell.

Use thead for the header rows, tbody for the data, and caption for the table title. Use colspan to make one cell span several columns.

Show example

<table>
  <caption>Fruit prices</caption>
  <thead><tr><th>Fruit</th><th>Price</th></tr></thead>
  <tbody><tr><td>Mango</td><td>80</td></tr></tbody>
</table>

✍️ Your turn

Make a table with the headers Name and Score, and one row: Rahim and 90.

← Back to course