HTML元素 - td

定义

指定表格中的单元格。

Specifies a cell in a table.

注释

table 对象及其相关的元素有各自独立的表格对象模型,这与常规对象模型所采用的方法有很大不同。要获得关于表格对象模型更多的信息,请参看如何动态生成表格。

此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的脚本中可用。

此元素是块元素。

此元素需要关闭标签。

The table object and its associated elements have a separate table object model, which utilizes different methods than the general object model. For more information on the table object model, see How to Build Tables Dynamically.

The TD element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0.

This element is a block element.

This element requires a closing tag.

示例代码

<TABLE BORDER=1 WIDTH=80%>
<THEAD>
<TR>
<TH>标题 1</TH>
<TH>标题 2</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>第 1 行, 第 1 列文本。</TD>
<TD>第 1 行, 第 2 列文本。</TD>
</TR>
<TR>
<TD>第 2 行, 第 1 列文本。</TD>
<TD>第 2 行, 第 2 列文本。</TD>
</TR>
</TBODY>
</TABLE>

另见

table, th, tr