A small price table

Show three prices in a table.

What to build

A table with a header row and two rows of data.

Requirements

  • A header row with two th cells: Item and Price.
  • A row with td cells Tea and 20.
  • A row with td cells Coffee and 50.

Constraints

Use one table element, with no colspan.

Example

Each tr is one row, and the cells inside it are read from left to right.

Why it works

The browser lines up the cells of each row into columns, so you only need to describe the rows.

Hints

Hint 1

Each row is one tr. The first row uses th and the others use td.

Solution

Show one correct solution (try it yourself first)
<table>
  <tr><th>Item</th><th>Price</th></tr>
  <tr><td>Tea</td><td>20</td></tr>
  <tr><td>Coffee</td><td>50</td></tr>
</table>

Lesson: Tables for data that has rows and columns →