袁奇生

To always face my adversity head on.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
 1      .table{
 2             font-size: 12px;
 3             border-collapse: collapse;
 4             border-top: 1px solid #7f9db9;
 5             border-left: 1px solid #7f9db9;
 6         }
 7         .table td, .table th{
 8             height: 22px;
 9             vertical-align: middle;
10             border-bottom: 1px solid #7f9db9;
11             border-right: 1px solid #7f9db9;
12             padding: 2px;
13         }
14         .table th{
15             background-color: #c3daf9;
16         }

 表格的特性:

1、单元格默认平分table的宽度

2、th里面的内容默认加租并且左右上下居中

3、td里面的内容默认上下居中,左右对齐显示

4、table的宽度决定了整个表格的宽度

5、table里面的单元格的宽度会被转换成百分比

6、表格里面的每一列必须有宽度

7、表格的同一列或行会继承最大值

8、th、td没有margin属性

表格的样式

  width宽度 、height高度、border边框

  border-spacing:x y;   指定单元格边界之间水平和垂直间距。

  border-collaspse:collaspe   边框合并为一个单一的边框会忽略border-spacing的值

  重置表格默认样式

    table{border-collaspse:collaspe;}

    table th,table td{padding:0;}

posted on 2020-03-14 09:37  逼近精进  阅读(1442)  评论(0编辑  收藏  举报