<td>: The TD Element

Last updated: 2026-10-13

<td>The TD Element

A standard table data cell holding the content at a row/column intersection.

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

📝 Syntax

<td>Cell content</td>

⚙️ Attributes

This element supports the global attributes plus the following:

AttributeValueDescription
colspanNumber of columns to span.
rowspanNumber of rows to span.
headersIDs of related header cells (complex tables).

▶ Example

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

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
<td> ✓ v1 ✓ v12 ✓ v1 ✓ v1 ✓ v1
Supported in all major browsers
Tip: td vs th: th is a header, td is data — the difference is semantic.

❓ FAQ

QWhat is the difference between td and th?
A<td> is a data cell; <th> is a header cell (bold-centered by default, carrying scope semantics). Screen readers use th to build row/column associations — column 3, Q2 row. A table of only td cells is just numbers without context to assistive technology.
QHow do colspan and rowspan work on td?
Acolspan='3' spans three columns, rowspan='2' spans two rows; both can combine. Remember the same row needs fewer cells after merging — and heavy criss-cross merging makes tables unmaintainable; restructure instead when you can.
QCan td contain block elements?
AYes, td is a transparent container allowing paragraphs, lists, even nested tables. But nested tables hurt readability and accessibility — split rows and columns instead; and wrap long text in <p> rather than leaving it bare.
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%

🙏 帮我们做得更好

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

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