一段實現井字形表格的CSS,相容IE7、IE8、IE9、IE10、Firefox、Chrome

來源:互聯網
上載者:User

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,並可設定內邊框的邊框樣式。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.