2011-02-13 71 views
0

我的CSS幾乎在每個瀏覽器都支持,但IE 6似乎並不想給我想要的結果。IE 6錶行背景顏色?

http://99.241.156.130/?page=course

表有條紋他們,但出於某種原因在IE6中,他們出現在列和行之間有白色間隙。

任何幫助將是偉大的! :)

+5

與其試圖讓它在IE6中看起來完全一樣,請接受該網站正常工作,看起來適當並繼續前進。 IE6比它的價值更麻煩(特別是在Google很快停止它的情況下),並且你的網站(幸好)不必在每個瀏覽器中都看起來相同。/soapbox – Dominic 2011-02-13 23:35:46

回答

0

在這個例子中沒有css,但你可以通過額外的風格標籤代碼來輕鬆完成。它是多瀏覽器便攜式。

<div align="center"><table id="myBoostTable" width="760" height="96" cellpadding="5" border="1" cellspacing="0" style="border-color:#000000;font-size:11px; border-collapse:collapse"><tr id="header"> <th align = "center" style="font-size:14px;font-family:Times New Roman;font-weight:700;font-style:normal;border-top-color:#000000;border-bottom-color:#000000;border-top: 1px solid #000000;border-bottom: 1px solid #000000;border-left-color:#000000;border-left: 1px solid #000000;border-right-color:#808080;border-right: 1px solid #808080 " width="380"height="24" bgcolor="#EDEDF1"><font color = "#000000">This is my title col 1</font></th><th align = "center" style="font-size:14px;font-family:Times New Roman;font-weight:700;font-style:normal;border-top-color:#000000;border-bottom-color:#000000;border-top: 1px solid #000000;border-bottom: 1px solid #000000;border-left-color:#808080;border-left: 1px solid #808080;border-right-color:#000000;border-right: 1px solid #000000 " width="380"height="24" bgcolor="#EDEDF1"><font color = "#000000">This is my title col 2</font></th></tr><tr > <td align = "left" style="font-size:12px;font-family:Times New Roman;font-weight:400;font-style:normal;border-top-color:#000000;border-top: 1px solid #000000;border-bottom-color:#D3D3D3;border-bottom: 1px solid #D3D3D3;border-left-color:#000000;border-left: 1px solid #000000;border-right-color:#808080;border-right: 1px solid #808080 " width="380" height="24" bgcolor="#FFFFFF"><font color = "#000000">content 1-1</font></td><td align = "left" style="font-size:12px;font-family:Times New Roman;font-weight:400;font-style:normal;border-top-color:#000000;border-top: 1px solid #000000;border-bottom-color:#D3D3D3;border-bottom: 1px solid #D3D3D3;border-left-color:#808080;border-left: 1px solid #808080;border-right-color:#000000;border-right: 1px solid #000000 " width="380" height="24" bgcolor="#F3EFFF"><font color = "#000000">content 1-2</font></td></tr><tr > <td align = "left" style="font-size:12px;font-family:Times New Roman;font-weight:400;font-style:normal;border-top-color:#D3D3D3;border-top: 1px solid #D3D3D3;border-bottom-color:#D3D3D3;border-bottom: 1px solid #D3D3D3;border-left-color:#000000;border-left: 1px solid #000000;border-right-color:#808080;border-right: 1px solid #808080 " width="380" height="24" bgcolor="#FAFAFF"><font color = "#000000">content 2-1</font></td><td align = "left" style="font-size:12px;font-family:Times New Roman;font-weight:400;font-style:normal;border-top-color:#D3D3D3;border-top: 1px solid #D3D3D3;border-bottom-color:#D3D3D3;border-bottom: 1px solid #D3D3D3;border-left-color:#808080;border-left: 1px solid #808080;border-right-color:#000000;border-right: 1px solid #000000 " width="380" height="24" bgcolor="#EEEAFF"><font color = "#000000">content 2-2</font></td></tr><tr > <td align = "left" style="font-size:12px;font-family:Times New Roman;font-weight:400;font-style:normal;border-top-color:#D3D3D3;border-top: 1px solid #D3D3D3;border-bottom-color:#000000;border-bottom: 1px solid #000000;border-left-color:#000000;border-left: 1px solid #000000;border-right-color:#808080;border-right: 1px solid #808080 " width="380" height="24" bgcolor="#FFFFFF"><font color = "#000000">content 3-1</font></td><td align = "left" style="font-size:12px;font-family:Times New Roman;font-weight:400;font-style:normal;border-top-color:#D3D3D3;border-top: 1px solid #D3D3D3;border-bottom-color:#000000;border-bottom: 1px solid #000000;border-left-color:#808080;border-left: 1px solid #808080;border-right-color:#000000;border-right: 1px solid #000000 " width="380" height="24" bgcolor="#F3EFFF"><font color = "#000000">content 3-2</font></td></tr></table></div> 
1

如果您在列和行之間獲得空白的可能性比在cellpadding和cellspacing中的值更大。將它們都設置爲0將消除間隙。