How can I hide an HTML table row <tr>
so that it takes up no space? I have several <tr>
's set to style="display:none;"
, but they still affect the size of the table and the table's border reflects the hidden rows.
views:
2891answers:
6Can you include some code? I add style="display:none;"
to my table rows all the time and it effectively hides the entire row.
Add some of the following line-height:0px;font-size:0px;height:0px;margin:0;padding:0;
I forget which one does it. I think it's line-height for IE6.
If display: none;
doesn't work, how about setting height: 0;
instead? In conjunction with a negative margin (equal to, or greater than, the height of the top and bottom borders, if any) to further remove the element? I don't imagine that position: absolute; top: 0; left: -4000px;
would work, but it might be worth a try.
For my part, using display: none
works fine.
I would really like to see your TABLE's styling. E.g. "border-collapse"
Just a guess, but it might affect how 'hidden' rows are being rendered.
This happened to me and I was baffled as to why. Then I noticed that if i removed any nbsp; i had within the rows, then the rows didn't take up any space.
Present Address " maxlength="40" style="width: 200px" /> " maxlength="40" style="width: 200px" />
I am not able to figure out that the previous row of 174 matches with the next row of 182 in perfect how to get rid of this problem