HTML col valign 屬性
實例
具有不同垂直對齊方式的列的表格:
<table border="1"
style="height:200px">
<col valign="top">
<col valign="bottom">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<col valign="top">
<col valign="bottom">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
嘗試一下»
瀏覽器支持
只有Internet Explorer 和Opera 支持valign 屬性。 但是, IE 和Opera 不支持值為"baseline".
定義和用法
HTML5不再支持<col> valign屬性。
align 屬性規定與<col> 元素相關的內容的垂直對齊方式。
語法
<col valign="top|middle|bottom|baseline">
屬性值
值 | 描述 |
---|---|
top | 对内容进行上对齐。 |
middle | 对内容进行居中对齐(默认值)。 |
bottom | 对内容进行下对齐。 |
baseline | 与基线对齐。 |
基線是一條虛構的線。 在一行文本中,大多數字母以基線為基準。 baseline 值設置行中的所有表格數據都分享相同的基線。 該值的效果常常與bottom 值相同。 不過,如果文本的字號各不相同,那麼baseline 的效果會更好。 請看下面的圖示:
valign="bottom"
valign="baseline"
HTML <col>標籤