When I hide a textbox in a table, is the table expected to reformat the space?
I have input type = text in a table (actually in TD) When the user clicks a checkbox, the input is hidden with JQuery (using the hide method) This makes the input style "display: none;"
So far so good. Now that this has happened, the row the cell is in is downsized (the height is lowered) because the only thing left in the row is which <span>
height is lower than the input height. The end result of this is that the row gets smaller, and when you click on that checkbox again, the input reappears and the row gets larger.
It doesn't look that good, so I wondered if there is a way to prevent this?
And second: this is how it should work (resizing the table)?
a source to share
Try setting visibility : hidden instead hide()
, it doesn't remove the element from the document flow.
$(' ... ').css('visibility', 'hidden');
a source to share