1、表格和边框属性
Row 1, cell 1 | Row 1, cell 2 |
2、表格的表头
表头:
Heading | Another Heading |
---|---|
row 1,cell1 | row 1,cell2 |
row 2,cell1 | row 2,cell2 |
垂直的表头:
姓名 | Bill Gates |
---|---|
电话 | 55577854 |
地址 | 上海 |
3、表格中的空单元格
row 1,cell1 | row 1,cell2 |
row 2,cell2 |
4、表格的标题
Row 1, cell 1 | Row 1, cell 2 |
5、跨行和跨列的单元格
横跨两列的单元格:
姓名 | 电话 | |
---|---|---|
Bill Gates | 55577854 | 55577855 |
横跨两行的单元格:
姓名 | Bill Gates |
---|---|
电话 | 55577854 |
55577855 |
6、表格内的标签
这是一个段落。 这是另一个段落。 | 这个单元包含一个表格:
| ||||
这个单元包含一个列表:
| HELLO |
7、单元格边距
使用 Cell padding 来创建单元格内容与其边框之间的空白。
没有 cellpadding:
First | Row |
Second | Row |
带有 cellpadding:
First | Row |
Second | Row |
8、单元格间距
使用 Cell spacing 增加单元格之间的距离。
没有 cellspacing:
First | Row |
Second | Row |
带有 cellspacing:
First | Row |
Second | Row |
9、向表格添加背景颜色或背景图像
背景颜色:
First | Row |
Second | Row |
背景图像:
First | Row |
Second | Row |
10、向表格单元格添加背景颜色或背景图像
单元背景:
First | Row |
Second | Row |
11、在表格单元格中排列内容
消费项目 | 一月 | 二月 |
---|---|---|
衣服 | $241.10 | $50.20 |
化妆品 | $30.00 | $44.45 |
食物 | $730.40 | $650.00 |
总计 | $1001.50 | $744.65 |
12、框架(from)属性
Table with frame="box":
Month | Savings |
---|---|
January | $100 |
Table with frame="above":
Month | Savings |
---|---|
January | $100 |
Table with frame="below":
Month | Savings |
---|---|
January | $100 |
Table with frame="hsides"
Month | Savings |
---|---|
January | $100 |
Table with frame="vsides"
Month | Savings |
---|---|
January | $100 |
13、表格的页眉、主体、页脚
thead {color: green}
tbody {color: blue;height: 50px}
tfoot {color: red}
MonthSavings
January$100February$80Sum$180