2011-10-25 162 views
1

我想隱藏表格單元格的邊框。 enter image description here使用css隱藏單元格邊框

如何使用css?如它所示,我需要隱藏標記的邊框(如第三和第二行)。

+0

您可以發佈HTML和CSS用於隱藏第二行和第三行的表嗎?也許那麼我們可以找出爲什麼它不適合第一個。 –

回答

2
<style> 
table { 
    border: 1px solid black; 
    width:100%; 
} 
table tr { 
    border: 1px solid black; 
} 
table th { 
    border: none; 
} 
</style> 

<table> 
    <thead> 
    <tr> 
     <th class="col1">1</th> 
     <th class="col2">2</th> 
     <th class="col3">3</th> 
    </tr> 
    </thead> 
</thead> 

在這裏看到:http://jsfiddle.net/AhHFP/

+0

我正在玩'td',而不是'th' – Rauf

+0

這有什麼區別嗎? – dmedvinsky

+0

是的!它不工作! – Rauf

1

試試這個

border-collapse:collapse; 
1

嘗試

td.col1 
{ 

    border-left:0px; 

} 
+0

它有什麼問題? –

1

試試這個。

table { 
border: 1px solid black; 
width:100%; 
border-collapse:collapse; 
}