How can I hide an HTML table row so that it takes up no space?

前端 未结 15 988
情歌与酒
情歌与酒 2020-12-25 09:15

How can I hide an HTML table row so that it takes up no space? I have several \'s set to style=\"display:none;\"

相关标签:
15条回答
  • 2020-12-25 09:54

    I was having same problem and I resolved the issue. Earlier css was overflow:hidden; z-index:999999;

    I change it to overflow:visible;

    0 讨论(0)
  • 2020-12-25 09:55

    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.

    0 讨论(0)
  • 2020-12-25 09:55

    You can set

    <table>
      <tr style="visibility: hidden"></tr>
    </table> 
    
    0 讨论(0)
  • 2020-12-25 09:56

    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.

    0 讨论(0)
  • 2020-12-25 09:56

    I was having the same issue, I even added style="display: none" to each cell.

    In the end I used HTML comments <!-- [HTML] -->

    0 讨论(0)
  • 2020-12-25 09:56
    var result_style = document.getElementById('result_tr').style;
    result_style.display = '';
    

    is working perfectly for me..

    0 讨论(0)
提交回复
热议问题