HTML <table> Tag
The <table> tag represents tabular data. Use <tr> for rows, <th> for header cells, <td> for data cells. Use <thead>, <tbody>, <tfoot> for structure and <caption> for a table title. Do not use tables for page layout—use for data only. Prefer CSS Grid or Flexbox for layout.
Structure and accessibility
Use scope="col" or scope="row" on <th> to associate headers with cells (screen readers). Use <caption> for the table title. colspan and rowspan merge cells when needed.
Best practices
Use tables only for tabular data. Wrap header rows in <thead>, body in <tbody>, footer in <tfoot>. Add <caption> and scope on <th> for accessibility.
