- 属性名:
able-layout
- 功能:设置列宽度
- 属性值:
auto
(默认值):自动,列宽根据内容计算
table-layout: auto;
fixed
:固定列宽,平均分
table-layout: fixed;
- 属性名:
border-spacing
- 功能:单元格间距
- 属性值:
CSS中可用的长度值
border-spacing: 10px;
生效的前提:单元格边框不能合并
- 属性名:
border-collapse
- 功能:合并单元格边框
- 属性值:
collapse
:合并
separate
:不合并
border-collapse: collapse;
border-collapse: separate;
- 属性值:
empty-cells
- 功能:隐藏没有内容的单元格
- 属性值:
show
:显示
hide
(默认):隐藏
empty-cells: show;
empty-cells: hide;
生效前提:单元格不能合并
- 属性值:
caption-side
- 功能:设置表格标题位置
- 属性值:
top
:上面(默认值)
bottom
:在表格下面
caption-side: top;
caption-side: bottom;
以上5个属性,只有表格才能使用,即:
<table>
标签