2个table样式

table.css

@charset "utf-8";
table{
	font-size:12px;
    table-layout:fixed;
    border-collapse: collapse;
    margin:0 auto;
}

td{
    height:25px;
}



/*第一套css*/
table.table1{
    border:1px solid #9db3c5;
    color:#633123;
	
}
table.table1 th {
    background-color:#B4CDCD;
    height:30px;
    color:#453a32;
	border:1px solid #a7d1fd;
    padding:0 2px 0;
}
table.table1 td{
    border:1px dotted #cad9ea;
	padding: 3px 0 0 0;
	text-align:center;
	height:25px;
}

table.table1 tr.interval{
    background-color:#e8f3fd;
}

/*第2套css*/
table.table2{
    border:1px solid #9db3c5;
    color:#CD0000;
}
table.table2 th {
    background-color:#EEE685;
    height:30px;
    color:#68228B;
	border:1px solid #a7d1fd;
    padding:0 2px 0;
}
table.table2 td{
    border:1px dotted #cad9ea;
	padding: 3px 0 0 0;
	text-align:center;
	height:25px;
}

table.table2 tr.interval{
    background-color:#e8f3fd;
}

应用页面:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>两套表格样式</title>
<link rel="stylesheet" type="text/css" href="table.css" />
<style type="text/css">
body{
    font-size:12px;
}
</style>
<script type="text/javascript">

</script>
</head>

<body>

<table width="98%" class="table1">
  <tr>
    <th>课程</th>
    <th>资料查询</th>
    <th>作者</th>
  </tr>

  <tr class="interval">
    <td>css</td>
    <td>http://www.w3school.com.cn/css/index.asp</td>
    <td>索隆</td>
  </tr>
  <tr>
    <td>css</td>
    <td>http://www.w3school.com.cn/css/index.asp</td>
    <td>索隆</td>
  </tr>
  <tr class="interval">
    <td>css</td>
    <td>http://www.w3school.com.cn/css/index.asp</td>
    <td>索隆</td>
  </tr>
  <tr>
    <td>css</td>
    <td>http://www.w3school.com.cn/css/index.asp</td>
    <td>索隆</td>
  </tr>
  <tr class="interval">
    <td>css</td>
    <td>http://www.w3school.com.cn/css/index.asp</td>
    <td>索隆</td>
  </tr>
</table>

</body>
</html>

效果:








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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值