TUTORIAL标准、参考与速查FETCHED

HTML <thead> align 属性

HTML &lt;thead&gt; align 属性 HTML &lt;thead&gt; 标签 实例 向左对齐 &lt;thead&gt; 元素中的内容: &lt;table border='1' width='100%'&gt; &lt;thead align=&..

更新于 2026/7/16

教程详情页默认 noindex。

HTML <thead> align 属性

HTML thead 标签参考手册 HTML <thead> 标签

实例

向左对齐 <thead> 元素中的内容:

<table border="1" width="100%">
  <thead align="left">
    <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

所有主流浏览器都支持 align 属性。

注意:IE 无法正确地处理 "justify" 值,IE 会以居中的方式进行处理。

注意:几乎没有浏览器能够正确地处理 "char" 值。


定义和用法

HTML5 不支持 <thead> align 属性。请使用 CSS 代替。

align 属性规定 <thead> 元素中的内容的水平对齐方式。


语法

<thead align="left|right|center|justify|char">

属性值

值 描述
left 左对齐内容。
right 右对齐内容。
center 居中对齐内容(表头元素的默认值)。
justify 对行进行伸展,这样每行都可以有相等的宽度(就像在报纸和杂志中)。
char 将内容对准指定字符。


HTML thead 标签参考手册 HTML <thead> 标签