我有几行的表.我希望第1和第3行高度设置为1 px,第2行设置为正常高度.但我的代码不起作用.
- <table border="0">
- <tr style="height:2px;" >
- <td width="10"><hr></td>
- </tr>
- <tr style="height:20px;" >
- <td width="10">Hello</td>
- </tr>
- <tr style="height:20px;" >
- <td width="10"><hr></td>
- </tr>
- </table>
谁能告诉我怎么做?@H_301_3@
注意:我不想使用边框,因为我想要某些行,我可能需要或不需要行内的水平线.@H_301_3@
解决方法
添加style =“padding:0px; margin:0px;”到你的小时,并将你的第三个tr的高度改为2px
你将会有 :@H_301_3@
- <table border="0">
- <tr style="height:2px;" >
- <td width="10px"><hr style="padding:0px; margin:0px;"></td>
- </tr>
- <tr style="height:20px;" >
- <td width="10px">Hello</td>
- </tr>
- <tr style="height:2px;" >
- <td width="10px"><hr style="padding:0px; margin:0px;"></td>
- </tr>
- </table>