时间:2021-07-01 10:21:17 帮助过:84人阅读
<table>...</table> - 定义表格
<tr> - 定义表行
<th> - 定义表头
<td> - 定义表元(表格的具体数据)
Food | Drink | Sweet |
---|---|---|
A | B | C |
不带边框的表格:
Food | Drink | Sweet |
---|---|---|
A | B | C |
跨多行、多列的表元(Table Span)
跨多列的表元 <th colspan=#>
Morning Menu | ||
---|---|---|
Food | Drink | Sweet |
A | B | C |
跨多行的表元 <th rowspan=#>
Morning Menu | Food | A |
---|---|---|
Drink | B | |
Sweet | C |
表格尺寸设置
<table border=#>
边框尺寸设置:Food | Drink | Sweet |
---|---|---|
A | B | C |
<table border width=# height=#>
表格尺寸设置:Food | Drink | Sweet |
---|---|---|
A | B | C |
<table border cellspacing=#>
表元间隙设置:Food | Drink | Sweet |
---|---|---|
A | B | C |
<table border cellpadding=#>
表元内部空白设置:Food | Drink | Sweet |
---|---|---|
A | B | C |
表格内文字的对齐/布局
<tr align=#>
<th align=#> #=left, center, right
<td align=#>
Food | Drink | Sweet |
---|---|---|
A | B | C |
<tr valign=#>
<th valign=#> #=top, middle, bottom, baseline
<td valign=#>
Food | Drink | Sweet | Other |
---|---|---|---|
A | B | C | D |
表格在页面中的对齐/布局(Floating Table)
<table align=left>
Food | Drink | Sweet |
---|---|---|
A | B | C |
My favorites...
cookies, chocolates, and more.
<table align=right>
Food | Drink | Sweet |
---|---|---|
A | B | C |
My favorites...
cookies, chocolates, and more.
<table vspace=# hspace=#> #=space value
Food | Drink | Sweet |
---|---|---|
A | B | C |
My favorites...
cookies, chocolates, and more.
表格的标题
<caption align=#> ... </caption> #=left, center, right
Food | Drink | Sweet |
---|---|---|
A | B | C |
<caption valign=#> ... </caption> #=top, bottom
valign=top is default.
Food | Drink | Sweet |
---|---|---|
A | B | C |