当前位置: 首页 > 文档资料 > HTML 入门教程 >

<td>

优质
小牛编辑
115浏览
2023-12-01

描述 (Description)

HTML

标记用于指定表中的单元格或表格数据。

例子 (Example)

<!DOCTYPE html>
<html>
   <head>
      <title>HTML td Tag</title>
   </head>
   <body>
      <table border = "1">
         <tr>
            <th>Subject</th>
            <th>Topic</th>
         </tr>
         <tr>
            <td>Java</td>
            <td>Threading</td>
         </tr>
         <tr>
            <td>C++</td>
            <td>Virtual Functions</td>
         </tr>
         <tr>
            <td>Linux</td>
            <td>File Systems</td>
         </tr>
      </table>
   </body>
</html>

全局属性 (Global Attributes)

此标记支持 - HTML Attribute Reference描述的所有全局属性

具体属性 (Specific Attributes)

HTML

标记还支持以下附加属性 -
属性描述
abbrabbreviated_textDeprecated - 指定单元格中内容的缩写版本。
alignright left center justify charDeprecated - 视觉对齐。
axisnameDeprecated - 指定此td的类别。 这可以潜在地用于对表数据执行查询,并且在语音浏览器的上下文中可以是有益的。
bgcolorrgb(x,x,x) #hexcode colornameDeprecated - 指定表格单元格的背景颜色。
charcharacterDeprecated - 指定要对齐文本的字符。 align =“char”时使用
charoff像素或%Deprecated - 指定使用char属性指定的第一个字符的对齐偏移(以像素或百分比值表示)。 align =“char”时使用
colspannumber指定当前单元格跨越的列数。
headerid指定以空格分隔的标题单元格列表,其中包含有关此单元格的信息。 该值需要与标题单元格的id相对应(使用id属性设置)。 此属性对非可视浏览器很有用。
heightpixelsDeprecated - 指定表格单元格的高度。
nowrapnowrapDeprecated - 防止文本自动换行。
rowspannumbers指定当前单元格跨越的行数。
scopecol colgroup row rowgroupDeprecated - 此属性用于标题单元格,并指定将使用此标题信息的单元格。
valigntop middle bottom baselineDeprecated - 垂直对齐。
width像素或%Deprecated - 指定表格单元格的宽度

事件属性 (Event Attributes)

此标记支持 - HTML Events Reference描述的所有事件属性

浏览器支持 (Browser Support)

ChromeFirefoxIEOperaSafariAndroid
YesYesYesYesYesYes