日期:2014-05-17  浏览次数:20574 次

奇怪的1像素间距 =。=
一个三行的表格,把中间的那行设成display:none,上下两行没有并拢,而是留了一个像素的间距,求解
代码如下:
-----------------------------------
<table   border= "0 "   cellspacing= "0 "   cellpadding= "0 ">
    <tr>
        <td   width= "164 "   style= "background:   #FF0000;   width:   100px;   height:   30px; "> </td>
    </tr>
    <tr>
        <td   style= "background:   #00ff00;   display:   none;   width:   100px;   height:   30px; "> </td>
    </tr>
    <tr>
        <td   style= "background:   #FF0000;   width:   100px;   height:   30px; "> </td>
    </tr>
</table>


------解决方案--------------------
<table border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td width= "164 " style= "background: #FF0000; width: 100px; height: 30px; "> </td>
</tr>
<tr style= "display: none; ">
<td style= "background: #00ff00; width: 100px; height: 30px; "> </td>
</tr>
<tr>
<td style= "background: #FF0000; width: 100px; height: 30px; "> </td>
</tr>
</table>