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
thcells:ItemandPrice. - A row with
tdcellsTeaand20. - A row with
tdcellsCoffeeand50.
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>