现在位置: 首页 > HTML 参考手册 > 正文

HTML <col> align 属性

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

实例

<table width="100%" border="1">
  <col align="left">
  <col align="left">
  <col align="right">
  <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 ExplorerFirefoxOperaGoogle ChromeSafari

只有 Opera 和 Internet Explorer 8 以及更早的IE版本支持 align属性(IE9不支持该属性)。


定义和用法

HTML5 不支持 <col> align 属性。

align 属性规定与 col 元素相关的内容的水平对齐方式。


语法

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

属性值

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


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