I have a table with vertical scroll. I keep some rows collapsed and managed by some script.
<html lang="en">
<head>
<style type="text/css">
table { border: 1px solid black;
border-collapse: collapse;
overflow-y: scroll;
display: inline-block; }
tr td { border: 1px solid black; }
tr.hide { visibility: collapse;}
</style>
</head>
<body>
<table>
<tr><td> Uno </p></td></tr>
<tr class="hide"><td> Due </p></td></tr>
<tr><td> Tre </p></td></tr>
<tr class="hide"><td> Quattro </p></td></tr>
</table>
</body>
</html>
To allow extra content I use overflow-y: scroll
and display: inline-block
, but this creates a space at the end of the table, after the last row, due to the hidden content. The table is sized correctly, but even if there is no overflow, a scroll bar is shown (scrolling the void).
I see this in Chrome and Firefox.
Any ideas on how to made those rows really invisible?