Loading…
Tables display data in rows and columns — think of a spreadsheet, a schedule, or a price comparison chart. They are one of the most powerful ways to organize structured data on the web.
<table>
<thead>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alice</td>
<td>25</td>
</tr>
<tr>
<td>Bob</td>
<td>30</td>
</tr>
</tbody>
</table>
| Element | Purpose |
|---|---|
<table> | The table container |
<thead> | The header section (column names) |
<tbody> | The body section (data rows) |
<tr> | A table row |
<th> | A table header cell (bold, centered by default) |
<td> | A table data cell (regular content) |
<thead> and <tbody> — they help screen readers distinguish headers from data.Create a table with:
<thead> row with 3 headers: "Product", "Price", "Stock"<tbody> with 2 data rows: