HTML table 对齐 align属性

HTML 表格对齐方式

align 属性规定表格相对于周围元素的对齐方式。这个东西有时候会忘掉.还是记录一下,以便下次查找.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<table>
<tbody>
<tr>
<td align="right">host:</td>
<td>localhost:8080</td>
</tr>
<tr>
<td align="right">user-agent:</td>
<td>Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0</td>
</tr>
<tr>
<td align="right">accept:</td>
<td>text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</td>
</tr>
<tr>
<td align="right">accept-language:</td>
<td>zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2</td>
</tr>
<tr>
<td align="right">accept-encoding:</td>
<td>gzip, deflate</td>
</tr>
<tr>
<td align="right">dnt:</td>
<td>1</td>
</tr>
<tr>
<td align="right">connection:</td>
<td>keep-alive</td>
</tr>
<tr>
<td align="right">cookie:</td>
<td>JSESSIONID=440BFA3EA210ECE5A1C1F5A040C52046</td>
</tr>
<tr>
<td align="right">upgrade-insecure-requests:</td>
<td>1</td>
</tr>
<tr>
<td align="right">cache-control:</td>
<td>max-age=0</td>
</tr>
</tbody>
</table>

显示效果:

host:localhost:8080
user-agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
accept-language:zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
accept-encoding:gzip, deflate
dnt:1
connection:keep-alive
cookie:JSESSIONID=440BFA3EA210ECE5A1C1F5A040C52046
upgrade-insecure-requests:1
cache-control:max-age=0

参考链接

http://www.w3school.com.cn/tags/att_table_align.asp