472,993 Members | 3,164 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 software developers and data experts.

What does visibility: collapse really mean (and do)?

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/
Jul 20 '05 #1
3 29604
In article <Xn*****************************@193.229.0.31> in
comp.infosystems.www.authoring.stylesheets, Jukka K. Korpela
<jk******@cs.tut.fi> wrote:
I've composed a trivial test page at
http://www.cs.tut.fi/~jkorpela/test/collapse.html
where the second row has visibility: collapse.


Neither button seems to have any effect at all. (Win 98 original,
Mozilla 1.4)

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #2
> 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.
Having read the specification and tried the test page you set up I do not
believe that any browser properly renders the collapse property.

Both Opera 7 and Mozilla Firebird 0.6 render the page as though the
visibility had been switched to none rather than collapse. Another test page
confirmed that the actual effect was identical in both browsers.

I created another testpage to investigate further, the only difference is
that the text in the second column of the second row is a little longer.

from this test page it can be seen that merely making the row invisible
preserves the width of the second column, when the row that causes the
column to be that width is not visible.
http://www.benmeadowcroft.com/me/arc.../collapse.html

The second testpage mrely confirms that with the display set to none to
width of the second column is not preserved.
http://www.benmeadowcroft.com/me/arc...splaynone.html
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?
What I believe should happen, and what none of the user agents tested
actually does, is resizing of the table, but not a reflowing of the widths
or heights of table cells. i believe this is the intention of this property.
The specification states that "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." If the table itself does not
change in size at all then where is the available space for other content?

I have "doctored" a couple of screen shots that illustrate what I think
should happen.

shows the table with a visibility set to visible
http://www.benmeadowcroft.com/me/arc.../collapse1.gif

shows the table with a visibility set to collapse
http://www.benmeadowcroft.com/me/arc.../collapse2.gif

The second screenshot shows how I believe the table should be reformatted.
The width of the second column is preserved, unlike when the display is set
to none. The difference between setting the visibility to collapse and the
visibility to hidden is that when an entire row (or column) is collapsed its
"box" is removed from the display, however it still has an effect on other
cells in the table.
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.
I think my doctored images make some sense in their application. Unlike
simply removing the row using display:none and causing a recalculation of
the table cell widths and heights etc a fairly simple mechanism (from some
points of view) is provided to remove rows and columns from the display,
without affecting the rest of the table.

I actually think there are some potential uses in the display of data. I
have a background in finance so I have made extensive use of pivot tables
and can quickly grasp the potential utility of quickly showing and hiding
and sub totals and grand totals etc. By retaining the widths and heights of
the columns and rows it is much easier to "keep your place on the screen" as
it were, if the table columns changed widths every time you hid a row
keeping track of where you are in the table could become increasingly
problematic.
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.


I do not know of any browser that supports it.

I hope I have made clear my understanding of the matter, I think it could be
quite useful where it to be implemented. I feel like a bug report for
mozilla coming on!

--
BenM
http://www.benmeadowcroft.com/
Jul 20 '05 #3
> I hope I have made clear my understanding of the matter, I think it
could be quite useful where it to be implemented. I feel like a bug
report for mozilla coming on!


Just looked in bugzilla and found this bug
http://bugzilla.mozilla.org/show_bug.cgi?id=77019

from the comments
"Oh Noooooo, we had the collapse code working in the tree for years and it
was
simply optimized away. Hmm may be optimized is not the correct word for it."

I guess someone didn't understand what "refactoring" is supposed to mean and
screwed up!
The bug is still marked as NEW so I'll pop in a vote for it.
--
BenM
http://www.benmeadowcroft.com/
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
1
by: Holmespundit | last post by:
Stylists... I'm having problems collapsing a column. Specifically, I want to collapse the last column of a table. My initial test with a large data set worked, but I cannot make it work with a...
58
by: Larry David | last post by:
Ok, first of all, let's get the obvious stuff out of the way. I'm an idiot. So please indulge me for a moment. Consider it an act of "community service".... What does "64bit" mean to your friendly...
2
by: Jenny | last post by:
My codebehind file contains a lot of sub's. Is there a fast way to expand and collapse them in the VisualStudio? It's really exhausting to collapse them all after opening the project in the...
8
by: Howard Kaikow | last post by:
I got bored today, so I decided to rewrite the code in KB article 316383 to decrease the number of object references. This resulted in a number of nested With ... End With. The original code had...
9
by: John Sidney-Woollett | last post by:
Is it possible to use the dblink and dblink_exec features from inside pl/pgsql functions to mimic the behaviour of nested transactions by calling another function or executing some SQL via the...
39
by: utab | last post by:
Dear all, Is there a clear distinction how to decide which functions to be members of a class and which not How is your attitude (Your general way from your experiences ...) "If the...
9
by: Jonathan Wood | last post by:
I found the following class on the Web: public class LoginRewriter : IHttpModule { void IHttpModule.Dispose() { } void IHttpModule.Init(HttpApplication app) { app.AuthorizeRequest += new...
0
by: stefcollect | last post by:
Hi all, I am pretty new to PHP and am stuck on - what I think - is a generic string handling problem. I need to read and manipulate some HTML files and have a problem in getting some...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.