Latest web development tutorials

HTML tbody charoff 屬性

HTML tbody 標籤參考手冊 HTML <tbody>標籤

實例

把<tbody> 元素中的內容與字符"." 向右兩個字符的位置對齊:

<table border="1" width="100%">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tbody align="char" char="." charoff="2">
<tr>
<td>January</td>
<td>$100.00</td>
</tr>
<tr>
<td>February</td>
<td>$80.00</td>
</tr>
</tbody>
</table>

嘗試一下»

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

注意:幾乎所有的主流瀏覽器都不支持charoff屬性。


定義和用法

HTML5不支持<tbody> charoff屬性。

charoff 屬性規定<tbody> 元素中的內容相對於由char 屬性規定的字符的對齊偏移量。

僅當align 屬性設置為"char" 且已設置char 屬性時,才能使用charoff 屬性。


語法

<tbody charoff="number">

屬性值

描述
number 规定对齐方式。
正数规定向字符的右边对齐。
负数规定向字符的左边对齐。


HTML tbody 標籤參考手冊 HTML <tbody>標籤