2015-11-03 208 views
0

在此示例表格中,我想从底部的空单元格中删除边框,尝试在css中使用border-collapse:collapse;但未成功。在html中删除表格单元格

<table id="tableID" border="1"> 
<tr width="80px" height="50px"> 
<td width="80px" height="50px">asdasdasdasdasdasd</td> 
<td width="80px" height="50px">asdasda</td> 
<td width="80px" height="50px">sadsadasd</td> 
<td width="80px" height="50px">sadsadasd</td> 
</tr> 
<tr> 
<td width="80px" height="50px">sasas</td> 
<td width="80px" height="50px">sdsadsa</td> 
<td width="80px" height="50px">sadasd</td> 
<td width="80px" height="50px">sdasd</td> 
</tr> 
<tr> 
<td rowspan="2"></td> 
<td width="80px" height="50px">asas</td> 
<td width="80px" height="50px">aaaas</td> 
<td width="80px" height="50px">ssssssa</td> 
</tr> 
<tr> 
<td colspan="2"></td> 
<td width="80px" height="50px">aaaas</td> 
</tr> 
</table> 
+0

我不清楚你想要什么。 '#tableID {border-collapse:collapse;}'删除整个表格的双边框 –

回答

0

这是你想要的吗?

小提琴:http://jsfiddle.net/15mjmy4j/

table { 
    border-collapse: separate; 
    empty-cells: hide; 
} 

这看起来更好,我认为。小提琴:http://jsfiddle.net/15mjmy4j/1/

table { 
    border-collapse: collapse; 
    empty-cells: hide; 
} 
+0

是的第一个,因为如果我拿第二个,在我的选择中,用户可能会认为那是预期的数据。 – changez

+0

@changez很酷,很高兴帮助。如果你觉得这个答案足够了,我不会介意它被接受。 =] – AtheistP3ace