2010-01-15 59 views
0

您好我剛添加cellpacing來獲得細胞之間的空間,但是這已經削減了電池的左手側的邊框。使用CELLSPACING和邊境崩潰:崩潰削減單元格邊框

這是因爲使用的邊界崩潰的發生:崩潰的所有表,但我在網上,這是標準化的跨瀏覽器閱讀。

如果這是真的。

我要保持邊境崩潰:所有表的崩潰?如果是的話,這是什麼修復。

對不起。

我使用IE7,但它必須是跨瀏覽器。

CSS例如

/*Universal selector: 
This rule set will be applied to every element in a document:*/ 
* 
{ 
margin:auto; 
padding:auto; 
/*text-align:center;*/ 
} 

/*The folowing rule will help to minimaze the differences between browesers*/ 
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,em,strong,th {font-size:1em; font-weight:normal; font-style:normal;} 
ul,ol {list-style:none;} 
img {border:none;} 
caption,th {text-align:left;} 
table {border-collapse:collapse ;border-spacing:0;font-size:1em; font-weight:normal; font-style:normal; font-family:Times New Roman;} 


.divTitle{ 
    margin:10px; 
} 
} 
.title 
{ 
font-weight:bold; 
color:#0076BF; 
font-size:1.4em; 
font-family:Times New Roman;  
} 

.divContainer 
{ 
margin:10px; 

background-color:#C7D8EE; 
border:2px solid #0076BF; 
text-align:left;  
} 

.tableContainer1 
{ 
color:#0076BF; 
margin:10px; 
border-spacing: 15px; 
empty-cells:show; 

} 

.tableContainer1 tbody tr td 
{ 
background-color:white; 
border:2px solid #0076BF; 
border-collapse:separate; 

} 
+0

請提供一個例子鏈接,所以我們可以螢火它。 – antpaw 2010-01-15 11:04:43

+0

..或粘貼您的HTML。也告訴我們哪個瀏覽器出現問題。 – 2010-01-15 11:06:30

回答

3

border-collapse除去細胞之間的所有間隔。如果你想要cellpacing,你可以使用border-spacingcss屬性。它在IE7及其以下版本中不起作用,但如果border-spacing存在,則所有其他瀏覽器都將忽略cellspacing屬性,因此您可以同時使用它們以使其在所有瀏覽器中都能正常工作。

,如果你想擁有的空間,不要使用border-collapse:collapse; ......