HTML < tr > align 属性,表格行中的对齐方式

 2022-06-22    522  

HTML <tr> align 属性

HTML <tr> 标签

HTML < tr > align 属性,表格行中的对齐方式

实例

带有居中对齐行的 HTML 表格:

<table width="100%" border="1">
  <tr align="center">
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr align="center">
    <td>January</td>
    <td>$100</td>
  </tr>
</table>

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

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

定义和用法

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

align 属性规定表格行中的内容的水平对齐方式。

语法

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

属性值

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


  •  标签:  
  • html
  •  

原文链接:https://77isp.com/post/1413.html

=========================================

https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。