You can use the visibility property to control whether an element is visible or not. This property can take one of the following values listed in the table below:
The style rule visibility: collapse; however removes the internal table elements, but it does not affect the layout of the table in any other way. The space normally occupied by the table elements will be filled by the subsequent siblings.
The display and visibility CSS properties appear to be the same thing, but they are in fact quite different and often confuse those new to web development.
Check out the following demo to find out how display and visibility affect the layouts.