tr – table row

<tr><td>…</td><td>…</td></tr>

A row of a table. It contains cells – header cells th and data cells td. The number of columns is determined by the cells (cells joined with colspan count by their width).

  • Default display: display: table-row
  • End tag: can be omitted – the row is ended by another tr or by the end of the group
  • Content: cells td and th
  • Where it can be used: thead, tbody, tfoot (or directly table – the browser adds tbody)
  • DOM interface: HTMLTableRowElement

Attributes

Only global attributes (the obsolete align, valign, bgcolor are replaced by CSS).

Examples

Striped rows:

<table class="stripes">
  <tr><td>Monday</td><td>310</td></tr>
  <tr><td>Tuesday</td><td>290</td></tr>
  <tr><td>Wednesday</td><td>305</td></tr>
</table>
.stripes {
  border-collapse: collapse;
}
.stripes tr:nth-child(odd) td {
  background: #f1f8e9;
}
.stripes td {
  padding: 2px 10px;
}
result
Monday310
Tuesday290
Wednesday305

Things to watch out for

  • A background, a border and padding on the row itself work only partly (a border only with border-collapse: collapse). Styling the cells is more reliable.
  • In JavaScript: tr.cells (the cells of the row), tr.rowIndex (its position in the table), tr.insertCell(), table.deleteRow(i).

Browser support

Baseline – widely available: works in all major browsers and has for a long time (since 2015 at the latest). Since version: Chrome 1, Firefox 1, Safari 1. As of October 2026 (MDN browser-compat-data).

Related:
table – table
td – table cell
th – header cell
tbody – table body