HTML table row height reduction

I have a table with several rows. I want the height of the 1st and 3rd line to be set to 1 px, and the second line to normal. But my code is not working.

enter image description here HTML code below

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

Can someone tell me how to do this?

Note I do not want to use borders because I want certain lines to or may not need a horizontal line inside the lines.

+6
source share
1 answer

Add style="padding:0px; margin:0px;" to your hr and change the height your third tr to 2px

You will have:

 <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> 
+10
source

Source: https://habr.com/ru/post/958949/


All Articles