I have noticed that the meaning of visibility: collapse has been discussed
on different forums, but with no consensus on what it really means.
Besides, implementations differ.
The specification says:
"The 'visibility' property takes the value 'collapse' for row, row group,
column, and column group elements. This value causes the entire row or
column to be removed from the display, and the space normally taken up by
the row or column to be made available for other content. The suppression
of the row or column, however, does not otherwise affect the layout of the
table. This allows dynamic effects to remove table rows or columns without
forcing a re-layout of the table in order to account for the potential
change in column constraints."
http://www.w3.org/TR/CSS2/tables.html#dynamic-effects
I've composed a trivial test page at
http://www.cs.tut.fi/~jkorpela/test/collapse.html
where the second row has visibility: collapse.
Does removing a row entirely from the display etc. mean that the display
is as if the row were not there? If yes, does it differ from display: none
in any other way than by being overridable in inner elements? If not, what
_does_ it mean? Specifically, how would it differ from visibility: hidden?
Does the obscure formulation "for the potential change in column
constraints" mean that visibility: collapse should behave the same way as
display: none but the allocation of widths and heights should take place
as if the element were present? This would make some sense in some weird
way. For example, if a table occupies the full width of the canvas (either
because it simply requires that much or has width: 100% set) and I
dynamically (i.e., via client-side scripting) set the visibility of a
column to collapse, then that column would be removed and all the columns
on the right of it shiften to the left accordingly, without changing thei
widths. This might make some practical sense, maybe.
Assuming this is the intended interpretation, does any browser support it?
IE 6 does not support visibility: collapse at all, which normally means
that the initial value visibility: visible is used. Opera 7 is said not to
support it, but it seems that it actually treats it as visibility: hidden.
The same applies to Mozilla 1.3, which has been said to support the
visibility: collapse. So I'm confused.
--
Yucca, http://www.cs.tut.fi/~jkorpela/