2013-04-05 52 views
1

有一張我已經給出邊框的表格。在給出邊界後,有一些谷歌搜索引擎出現雙邊邊界,我發現邊界崩潰是我的救世主。但試圖以各種可能的方式使用它後,它不起作用。在表格的每一行都會出現雙邊框

底部有一個雙邊框,即將要刪除。

爲了更好地理解附截圖: enter image description here

我想刪除的每個單元后,未來的雙邊框。

標記。

<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse;"> 
    <thead> 
     <tr> 
     <th > 
      Login Name 
     </th> 
     <th> 
      SheetName 
     </th> 
     </tr> 
    </thead> 
    <tr> 
     <td>aaa</td> 
     <td>abc</td> 
    </tr> 
    <tr> 
     <td>asdfasdf</td> 
     <td>aasdfsadfbc</td> 
    </tr> 
</table> 
+0

請加上CSS樣式,以及。 – 2013-04-05 06:44:36

+0

你在測試哪個瀏覽器?似乎Chrome和Firefox中的[work](http://jsfiddle.net/cLnFE/)。 – Vucko 2013-04-05 06:45:36

+0

它作爲模板附加在電子郵件中 – ankur 2013-04-05 06:47:52

回答

1

需要CSS才能提供確切的答案。正如其他人所說,確保沒有任何全局CSS文件改變您的HTML。看起來你的CSS裏有一個tr {margin-top:10px;}設置,或者提供類似效果的東西。

出於好奇,爲什麼你使用HTML cellpadding屬性? CSS填充屬性可以執行相同的功能,並提供更多的靈活性。你也會發現,從你的HTML中分離你的樣式(CSS)會比修改每個內聯樣式更容易更改和更新。

<table id="table"> 
     <thead> 
      <tr> 
       <th > 
        Login Name 
       </th> 
       <th> 
        SheetName 
       </th> 
      </tr> 
     </thead> 
<tr><td>aaa</td><td>abc</td></tr> 
<tr><td>asdfasdf</td><td>aasdfsadfbc</td></tr> 
    </table> 

CSS:

#table { 
    padding: 10px 5px 10px 5px; 
    //this is shortand for top right bottom left 
    border-collapse: collapse; 
    //this is becoming deprecated and is mainly used to support older versions of IE 
} 
相關問題