HTML <thead> valign 屬性

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

實例

把 <thead> 元素中的內容垂直居中對齊:

<table border="1" width="100%">
<thead valign="middle">
<tr>
<th>Month</th>
      <th>Savings</th>
</tr>
</thead>
    <tr>
      <td>January</td>
<td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
</tr>
</table>


流覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流流覽器都支持 valign 屬性。


定義和用法

HTML5 不支持 <thead> valign 屬性。請使用 CSS 代替。

valign 屬性規定 <thead> 元素中的內容的垂直對齊方式。


語法

<thead valign="top|middle|bottom|baseline">

屬性值

描述
top 對內容進行上對齊。
middle 對內容進行居中對齊(默認值)。
bottom 對內容進行下對齊。
baseline 與基線對齊。基線是一條虛構的線。在一行文本中,大多數字母以基線為基準。baseline 值設置行中的所有表格數據都分享相同的基線。該值的效果常常與 bottom 值相同。不過,如果文本的字型大小各不相同,那麼 baseline 的效果會更好。請看下麵的圖示。

當文本的字型大小不同時,bottom vs. baseline 圖示:

valign="bottom"

valign="baseline"


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