表格(TABLE)标记(TAGS)详细介绍
<table>...</table> - 定义表格
<tr> - 定义表行
<th> - 定义表头
<td> - 定义表元(表格的具体数据)
<table border>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
Food | Drink | Sweet |
---|---|---|
A | B | C |
不带边框的表格
<table>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
Food | Drink | Sweet |
---|---|---|
A | B | C |
跨多行、多列的表元(Table Span)
跨多列的表元 <th colspan=#>
<table border>
<tr><th colspan=3> Morning Menu</th>
<tr><th>Food</th> <th>Drink</th> <th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
Morning Menu | ||
---|---|---|
Food | Drink | Sweet |
A | B | C |
跨多行的表元 <th rowspan=#>
<table border>
<tr><th rowspan=3> Morning Menu</th>
<th>Food</th> <td>A</td></tr>
<tr><th>Drink</th> <td>B</td></tr>
<tr><th>Sweet</th> <td>C</td></tr>
</table>
Morning Menu | Food | A |
---|---|---|
Drink | B | |
Sweet | C |
表格尺寸设置
<table border=#>
边框尺寸设置<table border=10>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
Food | Drink | Sweet |
---|---|---|
A | B | C |
<table border width=# height=#>
表格尺寸设置<table border width=170 height=100>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
Food | Drink | Sweet |
---|---|---|
A | B | C |
<table border cellspacing=#>
表元间隙设置<table border cellspacing=10>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
Food | Drink | Sweet |
---|---|---|
A | B | C |
<table border cellpadding=#>
表元内部空白设置<table border cellpadding=10>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
Food | Drink | Sweet |
---|---|---|
A | B | C |
表格内文字的对齐/布局
<tr align=#>
<th align=#> #=left, center, right
<td align=#>
<table border width=160>
<tr>
<th>Food</th><th>Drink</th><th>Sweet</th>
<tr>
<td align=left>A</td>
<td align=center>B</td>
<td align=right>C</td>
</table>
Food | Drink | Sweet |
---|---|---|
A | B | C |
<tr valign=#>
<th valign=#> #=, middle, bottom, baseline
<td valign=#>
<table border height=100>
<tr>
<th>Food</th><th>Drink</th>
<th>Sweet</th><th>Other</th>
<tr>
<td valign=>A</td>
<td valign=middle>B</td>
<td valign=bottom>C</td>
<td valign=baseline>D</td>
</table>
Food | Drink | Sweet | Other |
---|---|---|---|
A | B | C | D |
表格在页面中的对齐/布局(Floating Table)
<table align=left>
<table align="left" border>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
My favorites...<br> cookies, chocolates, and more.
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
<table align="left" border vspace=20 hspace=30>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
My favorites...<br> cookies, chocolates, and more.
Food | Drink | Sweet |
---|---|---|
A | B | C |
My favorites...
cookies, chocolates, and more.
表格的标题
<caption align=#> ... </caption> #=left, center, right
<table border>
<caption align=center>Lunch</caption>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
Food | Drink | Sweet |
---|---|---|
A | B | C |
<caption valign=#> ... </caption> #=, bottom
valign= is default.
<table border>
<caption valign=bottom>Lunch</caption>
<tr><th>Food</th><th>Drink</th><th>Sweet</th>
<tr><td>A</td><td>B</td><td>C</td>
</table>
Food | Drink | Sweet |
---|---|---|
A | B | C |
长沙网站设计
- 如何进行东阳SEO关键词优化?
- 边坝哪有关键词排名优化:提升你的网站流量与
- 安国百度优化服务:提升您的在线可见性
- 阜康新手做SEO怎么做
- 山西seo网站排名关键词优化:提升您网站曝光率
- 临沂seo网站排名关键词优化:提高你的网站可见
- 广西SEO网站推广怎样付费比较合理
- 双辽SEO网站推广:提升你的网站可见性与流量
- 辽宁企业网站优化购买方式有哪些
- 提升宝清百度SEO排名的实用技巧与策略
- 静宁百度SEO排名:提升您网站曝光率的关键策略
- 彭州百度SEO排名的提升策略和实施指南
- 广南百度关键词SEO:提升网站排名的关键策略
- 辽宁关键词优化怎么做论坛营销
- 吉林百度seo排名如何做到让用户满意
- 内黄百度优化服务:提升在线可见性的关键