一段实现井字形表格的CSS,兼容IE7、IE8、IE9、IE10、Firefox、Chrome

效果图:

html+css代码:

html+css
 1 <!DOCTYPE html>
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 5     <title>井字形表格</title>
 6     <style type="text/css">
 7         table {
 8             border-collapse: collapse;
 9             border: none;
10             background-color: #ccc;
11         }
12 
13             table td {
14                 border: 1px dashed black;
15                 padding: 5px;
16                 border-bottom: none; /*去除表格下边的边框*/
17                 border-right: none; /*去除表格右边的边框*/
18             }
19 
20             /*去除表格上边的边框*/
21             table tr:first-child td {
22                 border-top: none;
23             }
24 
25             /*去除表格左边的边框*/
26             table tr td:first-child {
27                 border-left: none;
28             }
29     </style>
30 </head>
31 <body>
32     <table>
33         <tr>
34             <td>内容</td>
35             <td>内容</td>
36             <td>内容</td>
37             <td>内容</td>
38         </tr>
39         <tr>
40             <td>内容</td>
41             <td>内容</td>
42             <td>内容</td>
43             <td>内容</td>
44         </tr>
45         <tr>
46             <td>内容</td>
47             <td>内容</td>
48             <td>内容</td>
49             <td>内容</td>
50         </tr>
51         <tr>
52             <td>内容</td>
53             <td>内容</td>
54             <td>内容</td>
55             <td>内容</td>
56         </tr>
57         <tr>
58             <td>内容</td>
59             <td>内容</td>
60             <td>内容</td>
61             <td>内容</td>
62         </tr>
63     </table>
64 </body>
65 </html>

兼容IE7、IE8、IE9、IE10、Firefox、Chrome,并可设置内边框的边框样式。

转载于:https://www.cnblogs.com/chengyujia/archive/2013/02/01/2889437.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值