HTML: <thead> align 属性

由网友 大卫 发布 阅读 6

HTML: <thead> align 属性

<thead> align 属性的使用方法,align属性指定 <thead>元素内内容的水平对齐方式,在线实例演示如何使用 <thead> align 属性、浏览器的兼容性、语法定义及它的属性值详细资料等。

 HTML <thead> 标签

在线示例

在<thead>元素内将内容右对齐:

<table style="width:100%;" border="1">
<thead align="right">
  <tr>
    <th height="50">娃娃制造商</th>
    <th height="50">娃娃类型</th>
  </tr>
  </thead>
  <tr>
    <td>芭比公主</td>
    <td>6关节芭比娃娃</td>
  </tr>
  <tr>
    <td>芭比公主</td>
    <td>12关节芭比娃娃</td>
  </tr>
</table>
测试看看 ‹/›

浏览器兼容性

IEFirefoxOperaChromeSafari

所有主流浏览器都支持 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> charoff 属性 HTML: <thead> char 属性