<td> 標(biāo)簽定義 HTML 表格中的標(biāo)準(zhǔn)單元格。
HTML 表格有兩類單元格:
td 元素中的文本一般顯示為正常字體且左對齊。
一個簡單的 HTML 表格,包含兩行兩列:
<table border="1"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr><td>January</td>
<td>$100</td>
</tr> </table>
在 HTML 4.01 中,td 元素的 "bgcolor"、"height"、"width" 以及 "nowrap" 是不被贊成使用的。
在 XHTML 1.0 Strict DTD 中,td 元素的 "bgcolor"、"height"、"width" 以及 "nowrap" 是不被支持的。
提示:請使用 colspan 和 rowspan 屬性來實現(xiàn)內(nèi)容橫跨多個行或列。
DTD 指示此屬性允許在哪種 DTD 中使用。S=Strict, T=Transitional, F=Frameset.
屬性 | 值 | 描述 | DTD |
---|---|---|---|
abbr | text | 規(guī)定單元格中內(nèi)容的縮寫版本。 | STF |
align |
|
規(guī)定單元格內(nèi)容的水平對齊方式。 | STF |
axis | category_name | 對單元進行分類。 | STF |
bgcolor |
|
不贊成使用。請使用樣式取而代之。 規(guī)定單元格的背景顏色。 |
TF |
char | character | 規(guī)定根據(jù)哪個字符來進行內(nèi)容的對齊。 | STF |
charoff | number | 規(guī)定對齊字符的偏移量。 | STF |
colspan | number | 規(guī)定單元格可橫跨的列數(shù)。 | STF |
headers | header_cells'_id | 規(guī)定與單元格相關(guān)的表頭。 | STF |
height |
|
不贊成使用。請使用樣式取而代之。 規(guī)定表格單元格的高度。 |
TF |
nowrap | nowrap |
不贊成使用。請使用樣式取而代之。 規(guī)定單元格中的內(nèi)容是否折行。 |
TF |
rowspan | number | 規(guī)定單元格可橫跨的行數(shù)。 | STF |
scope |
|
定義將表頭數(shù)據(jù)與單元數(shù)據(jù)相關(guān)聯(lián)的方法。 | STF |
valign |
|
規(guī)定單元格內(nèi)容的垂直排列方式。 | STF |
width |
|
不贊成使用。請使用樣式取而代之。 規(guī)定表格單元格的寬度。 |
TF |
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
如需完整的描述,請訪問事件屬性。
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答!! 點擊進入論壇