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 |
|---|---|
| <code><table></code> | The table container |
| <code><thead></code> | The header section (column names) |
| <code><tbody></code> | The body section (data rows) |
| <code><tr></code> | A table row |
| <code><th></code> | A table header cell (bold, centered by default) |
| <code><td></code> | 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: