漂亮的表格样式

CSS控制,漂亮的表格样式

2008-11-04 18:58:00 | 【大 中 小】
 
 
CONFIGURATIONSDUAL 1.8GHZDUAL 2GHZDUAL 2.5GHZ
LIPENGM9454LL/AM9455LL/AM9457LL/A
MAPABCDual 1.8GHz PowerPC G5Dual 2GHz PowerPC G5Dual 2.5GHz PowerPC G5
频率900MHz per processor1GHz per processor1.25GHz per processor
2级缓存512K per processor512K per processor512K per processor

用CSS美化表格的样式,看起来非常的柔和、舒服

查看全部代码 View Code

第一步: 
在网页<head>区添加样式定义 

01<style type="text/css">
02/* CSS Document */
03 
04body {
05    font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
06    color: #4f6b72;
07    background: #E6EAE9;
08}
09 
10a {
11    color: #c75f3e;
12}
13 
14#mytable {
15    width: 700px;
16    padding: 0;
17    margin: 0;
18}
19 
20caption {
21    padding: 0 0 5px 0;
22    width: 700px;     
23    font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
24    text-align: right;
25}
26 
27th {
28    font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
29    color: #4f6b72;
30    border-right: 1px solid #C1DAD7;
31    border-bottom: 1px solid #C1DAD7;
32    border-top: 1px solid #C1DAD7;
33    letter-spacing: 2px;
34    text-transform: uppercase;
35    text-align: left;
36    padding: 6px 6px 6px 12px;
37    background: #CAE8EA url(images/bg_header.jpg) no-repeat;
38}
39 
40th.nobg {
41    border-top: 0;
42    border-left: 0;
43    border-right: 1px solid #C1DAD7;
44    background: none;
45}
46 
47td {
48    border-right: 1px solid #C1DAD7;
49    border-bottom: 1px solid #C1DAD7;
50    background: #fff;
51    font-size:11px;
52    padding: 6px 6px 6px 12px;
53    color: #4f6b72;
54}
55 
56 
57td.alt {
58    background: #F5FAFA;
59    color: #797268;
60}
61 
62th.spec {
63    border-left: 1px solid #C1DAD7;
64    border-top: 0;
65    background: #fff url(images/bullet1.gif) no-repeat;
66    font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
67}
68 
69th.specalt {
70    border-left: 1px solid #C1DAD7;
71    border-top: 0;
72    background: #f5fafa url(images/bullet2.gif) no-repeat;
73    font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
74    color: #797268;
75}
76/*---------for IE 5.x bug*/
77html>body td{ font-size:11px;}
78</style>


第二步: 
在网页<body>区需要显示表格的地方加上如下代码 
01<table id="mytable" cellspacing="0" summary="The technical specifications of the Apple PowerMac G5 series">
02<caption> </caption>
03  <tr>
04    <th scope="col" abbr="Configurations"class="nobg">Configurations</th>
05 
06    <th scope="col" abbr="Dual 1.8">Dual 1.8GHz</th>
07    <th scope="col" abbr="Dual 2">Dual 2GHz</th>
08    <th scope="col" abbr="Dual 2.5">Dual 2.5GHz</th>
09  </tr>
10  <tr>
11    <th scope="row" abbr="Model" class="spec">lipeng</th>
12    <td>M9454LL/A</td>
13 
14    <td>M9455LL/A</td>
15    <td>M9457LL/A</td>
16  </tr>
17  <tr>
18    <th scope="row" abbr="G5 Processor" class="specalt">mapabc</th>
19    <td class="alt">Dual 1.8GHz PowerPC G5</td>
20    <td class="alt">Dual 2GHz PowerPC G5</td>
21 
22    <td class="alt">Dual 2.5GHz PowerPC G5</td>
23  </tr>
24  <tr>
25    <th scope="row" abbr="Frontside bus" class="spec">频率</th>
26    <td>900MHz per processor</td>
27    <td>1GHz per processor</td>
28    <td>1.25GHz per processor</td>
29 
30  </tr>
31  <tr>
32    <th scope="row" abbr="L2 Cache" class="specalt">2级缓存</th>
33    <td class="alt">512K per processor</td>
34    <td class="alt">512K per processor</td>
35    <td class="alt">512K per processor</td>
36  </tr>
37 
38</table>

转载于:https://www.cnblogs.com/taomylife/p/3287616.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值