HTML <colgroup> 標(biāo)簽的 align 屬性
定義和用法
align 屬性規(guī)定列組中的內(nèi)容的水平對齊方式。
實(shí)例
兩個(gè) colgroup 元素為表格中的三列規(guī)定了不同的對齊方式和樣式(注意第一個(gè) colgroup 元素橫跨兩列):
<table width="100%" border="1"> <colgroup span="2"align="left"
></colgroup> <colgroupalign="right"
style="color:#0000FF;"></colgroup> <tr> <th>ISBN</th> <th>Title</th> <th>Price</th> </tr> <tr> <td>3476896</td> <td>My first HTML</td> <td>$53</td> </tr> </table>
瀏覽器支持
只有 Internet Explorer 和 Opera 支持 align 屬性。
注釋:IE 無法正確地處理 "justify" 值,IE 會(huì)以居中的方式進(jìn)行處理。
注釋:幾乎沒有瀏覽器能夠正確地處理 "char" 值。
語法
<colgroup align="value">
屬性值
值 | 描述 |
---|---|
left | 左對齊內(nèi)容(默認(rèn)值)。 |
right | 右對齊內(nèi)容。 |
center | 居中對齊內(nèi)容(th 元素的默認(rèn)值)。 |
justify | 對行進(jìn)行伸展,這樣每行都可以有相等的長度(就像在報(bào)紙和雜志中)。 |
char | 將內(nèi)容對準(zhǔn)指定字符。 |