减少HTML表行高度

时间:2013-11-27 19:44:12

标签: html css

我有几行的表。我希望第1和第3行高度设置为1 px,第2行设置为正常高度。但我的代码无效。

enter image description here HTML CODE低于

<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>

有人可以告诉我该怎么做吗?

注意:我不想使用边框,因为我想要某些行,我可能需要也可能不需要行内的水平线。

1 个答案:

答案 0 :(得分:12)

style="padding:0px; margin:0px;"添加到hr并将第三个height的{​​{1}}更改为tr

你将拥有:

2px