How to hide an HTML table row tr so that it takes up no space with CSS?

Spread the love

Sometimes, we want to hide an HTML table row tr so that it takes up no space with CSS.

In this article, we’ll look at how to hide an HTML table row tr so that it takes up no space with CSS.

How to hide an HTML table row tr so that it takes up no space with CSS?

To hide an HTML table row tr so that it takes up no space with CSS, we can set the visibility property.

For instance, we write

<tr style="visibility: collapse">
  <td>stuff</td>
</tr>

to add visibility: collapse to hide the tr element without it taking up space.

Conclusion

To hide an HTML table row tr so that it takes up no space with CSS, we can set the visibility property.

Leave a Reply

Your email address will not be published. Required fields are marked *