HTML: table

Use <table> when data has meaningful row-and-column relationships, such as prices, schedules, or comparisons.

What you will learn

Minimal example

<table>
  <caption>Opening hours</caption>
  <thead><tr><th scope="col">Day</th><th scope="col">Hours</th></tr></thead>
  <tbody><tr><th scope="row">Monday</th><td>9:00–17:00</td></tr></tbody>
</table>

<th> identifies a heading cell. Use scope="col" or scope="row" to make its relationship explicit, especially for assistive technology.

Common mistakes