為何table中border-spacing: 10px;不起作用啊?

來源:互聯網
上載者:User
我用樣式表:table { border-collapse: separate; border-spacing: 10px; border:1px solid #000000; } ,想讓表格儲存格分離,可是為什麼設定的border-spacing不起作用呢?請指教一下吧

我就是想用CSS實現如下這種效果,可是border-spacing: 10px; 不起作用

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>無標題文檔</title></head><body><table width="400" border="1" cellpadding="0" cellspacing="4" bordercolor="#000000">  <tr>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>  </tr>  <tr>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>  </tr>  <tr>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>  </tr></table></body></html>

我就是想用CSS實現如上這種效果,不知道用CSS怎樣才能實現在HTML設定的cellspacing="4" 效果,我試了border-spacing: 10px; 不起作用;請各位多多指教

ie+ff

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>無標題文檔</title><style type="text/css">table.tt{border-spacing:10px;}</style><!--[if IE]><style type="text/css">table.tt{sheneyan:expression(this.cellSpacing="10");}</style><![endif]--></head><body><table width="400" border="1" cellpadding="0" bordercolor="#000000" class="tt">  <tr>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>  </tr>  <tr>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>  </tr>  <tr>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>    <td>&nbsp;</td>  </tr></table></body></html>

不支援
但是為什麼要放棄table這麼好的內建功能。
用css來複雜化table。。

相關文章

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.