如何使用CSS實現細線表格效果,css實現細線表格

來源:互聯網
上載者:User

如何使用CSS實現細線表格效果,css實現細線表格

如何使用CSS實現細線表格效果:

雖然在使用布局的時候不提倡使用table,但是table並非是一個不能使用的元素,只要和CSS配合使用得當,還是具有相當的威力,並且在特地的情況使用table比使用div更有優勢,例如在製作表格,但是表格內建的邊框比較醜陋,下面介紹一下如何使用CSS實現細線表格效果。代碼執行個體如下:

<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="author" content="http://www.51texiao.cn/" /><title>螞蟻部落</title><style type="text/css">table{  width:300px;  height:60px;  background-color:green;}table td{  background-color:white;}</style></head><body><table cellspacing="1">  <tr>    <td>儲存格</td>    <td>儲存格</td>    <td>儲存格</td>    <td>儲存格</td>    <td>儲存格</td>  </tr>  <tr>    <td>儲存格</td>    <td>儲存格</td>    <td>儲存格</td>    <td>儲存格</td>    <td>儲存格</td>  </tr></table></body></html>

以上代碼通過設定table的cellspacing屬性值為1px,然後再設定table的背景顏色為綠色,再將儲存格的背景顏色設定為白色,那麼就能夠顯露出來1px的“邊框”效果。

原文地址是:http://www.51texiao.cn/div_cssjiaocheng/2015/0504/725.html

最為原始地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=4645

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.