<tr>: The TR Element

Last updated: 2026-10-13

<tr>The TR Element

A table row, made of th (header) or td (data) cells.

CategoryTables
Content ModelFlow content
Allowed ParentsAny element that accepts flow content
Content TagYes — requires closing </tr> tag
StatusStandard

📝 Syntax

<tr>
  <td>cell</td>
</tr>

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
<tr> ✓ v1 ✓ v12 ✓ v1 ✓ v1 ✓ v1
Supported in all major browsers
Tip: tr lives only inside thead, tbody or tfoot; wrap data rows in tbody for easier scripting.

❓ FAQ

QMust tr be wrapped in tbody?
AThe source may omit it (the browser adds an implicit tbody), but explicit grouping is more controllable: after writing bare <tr> under table, JS row operations and group styling all detour through that extra layer. Standardize on thead/tbody/tfoot.
QCan tr be displayed as block?
AYes, but it breaks table layout — cells lose their arrangement. That is exactly the basis of the responsive-rows-as-cards trick, paired with td data-labels and ::before pseudo-elements. Otherwise, never touch tr's display.
QCan text go directly inside tr?
ANo — tr's content model allows only th/td and script-support elements; bare text is invalid HTML and the browser pushes it outside the table. Wrap every piece of text in <td> or <th>.
More case studies coming soon — check back later.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏