table表格美化代码实例

表单经常用来阻止数据非常的好用,但是通常默认状态下的表格是很难看的,所以对它最好要有些基本的优化美观,下面就是一段能够对表格进行简单美化的代码实例,希望能够给大家带来借鉴作用。

代码如下:

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
< html >
< head >
< meta charset = " utf-8" >
< meta name = "author" content = "http://www.softwhy.com/" />
< title >蚂蚁部落</ title >
< style type = "text/css" >
body, table{font-size:12px;}
table{
   table-layout:fixed;
   empty-cells:show;
   border-collapse: collapse;
   margin:0 auto;
}
td{height:30px;}
h1, h2, h3{
   font-size:12px;
   margin:0;
   padding:0;
}
.table{
   border:1px solid #cad9ea;
   color:#666;
}
.table th{
   background-repeat:repeat-x;
   height:30px;
}
.table td, .table th{
   border:1px solid #cad9ea;
   padding:0 1em 0;
}
.table tr.alter{
   background-color:#f5fafe;
}
</ style >
</ head >
< body >
< table width = "90%" class = "table" >
   < tr >
     < th >学号</ th >
     < th >姓名</ th >
     < th >平时</ th >
     < th >期中</ th >
     < th >实验(践)</ th >
     < th >其它</ th >
     < th >期末</ th >
     < th >总评</ th >
   </ tr >
   < tr >
     < td >1</ td >
     < td >1</ td >
     < td >1</ td >
     < td >1</ td >
     < td >1</ td >
     < td >1</ td >
     < td >1</ td >
     < td >1</ td >
   </ tr >
   < tr class = "alter" >
     < td >2</ td >
     < td >2</ td >
     < td >2</ td >
     < td >2</ td >
     < td >2</ td >
     < td >2</ td >
     < td >2</ td >
     < td >2</ td >
   </ tr >
</ table >
</ body >
</ html >





原文发布时间为:2017-2-10

本文作者:admin

本文来自云栖社区合作伙伴“蚂蚁部落”,了解相关信息可以关注蚂蚁部落

原文链接:table表格美化代码实例


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值