setting CSS property visibility: collapse on COL element doesn't collapse the column (<col>, <colgroup>, table, style, visibility, collapsed)




Layout: Tables
17 years ago
11 years ago


(Reporter: Martin Honnen, Unassigned)


({css2, testcase})

css2, testcase

Firefox Tracking Flags

(Not tracked)


(Whiteboard: Visit bug 370353)


(2 attachments)



17 years ago
Accoding to the CSS 2 docs you should be able to collapse a table column by 
  visibility: collapse
on the COL element. I don't get that effect however with Mozilla.

<title>col test</title>
<input type="button" value="toggle column visibility"
       onclick="with (document.getElementById('aCol').style)
                 if (visibility == '')
                   visibility = 'collapse';
                   visibility = '';"
<table border="1">
<col id="aCol"
     style="background-color: blue;" 
     onmouseover="alert(event.type + ' for ' +;"
<col style="background-color: red;">
<a href=""></a>

Comment 1

17 years ago
Created attachment 31308 [details]
test case/bug demo (clicking the button toggles the first columns visibility property but the table display is not changed)
It actually looks like visibility:collapse just has no effect on <col> elements
(even if set with an inline style attribute).  Attaching testcase.

Seeing this on linux build 2001-04-17-08
Keywords: css2
OS: Windows 95 → All
Hardware: PC → All
Created attachment 31311 [details]
testcase using HTML 4.01 strict
Table layout problem, over to karnaze.
Assignee: jst → karnaze

Comment 5

17 years ago
And 'hidden' doesn't work, it only removes the background-color!

Comment 6

17 years ago
the border-collapsing code is currently disabled. Please see bug 41262
This bug is about column-collapsing, not border-collapsing.  Not the same thing.

Comment 8

17 years ago
Moving to m0.1.0.1
Target Milestone: --- → mozilla1.0.1

Comment 9

17 years ago
Is this a dupe of bug 32199?
No.  This is about elements with display:table-column, not about elements with
display:block or display:inline as bug 32199 is.  The behavior of
visibility:collapse is very different for things that have display:table-column
Keywords: testcase

Comment 11

16 years ago
This issue is similar to bug 77019 (which is about collapsing a table's row
rather than column).  I have found some cases where both rows and columns do and
do not behave correctly in Mozilla 1.0.0+ nightly builds (I am using build
2002051008 for OS/2).

Note the test in the Debug menu, Viewer Demos sub-menu, #4 Simple Tables.  The
first two examples of row and column collapsing can be extracted (copy and paste
from the page source to a new page) and they display collapsed rows and
collapsed columns as expected (see
which has been validated as HTML 4.01 by the w3c).

But then if we remove the third and fourth tables from that (simply deleting
those tables from the HTML code and leaving absolutely everything else in the
file intact) the first example of collapsed rows and collapsed columns fails
(see which has also been validated as
HTML 4.01 by the w3c).

Both pages are valid HTML and use exactly the same code for the first and second
tables.  The only difference is that the second test page above has had the
third and fourth tables deleted.  This simple act causes table 2 to display
incorrectly in test4a.html where it worked correctly in test4.html.  Same code
but different display even in the same browser version.  And this was the code
taken from the Mozilla debug tests which are included with the browser binaries.


16 years ago
Priority: -- → P3
Target Milestone: mozilla1.0.1 → Future

Comment 12

15 years ago
In 1.1 final for Linux, columns are hidden but not collapsed.  Also, reflowing
the page seems to make the column borders (but not content!) reappear.

Comment 13

15 years ago
mass reassign to default owner
Assignee: karnaze → table
Component: DOM Style → Layout: Tables
QA Contact: ian → madhur
Target Milestone: Future → ---


15 years ago
Target Milestone: --- → Future
Summary: setting CSS property visibility: collapse on COL element doesn't collapse the column → setting CSS property visibility: collapse on COL element doesn't collapse the column (<col>, <colgroup>, table, style, visibility, collapsed)
"display: none" have no effect on "<col>" either. Shouldn't this bug be of hire
priority since (a) it should work according to CSS and (b) it works correctly on IE.

Comment 16

14 years ago
no it should not have higher priority as there is already a patch in bug 77019
Depends on: 77019

Comment 17

14 years ago
fixed by checkin for bug 77019
Last Resolved: 14 years ago
Resolution: --- → FIXED

Comment 18

11 years ago

Comment 19

11 years ago

visibility: collapse on <col> and <colgroup> in border-collapse: separate model stopped working on the trunk for now quite some time (say, ~=6 weeks). In other words, test #5 (<col> visibility with border-collapse: separate) and test #7 (<colgroup> visibility with border-collapse: separate) taken from
attachment 147933 [details] 

were working before (say, ~=6 weeks; after reflow branch; at the time when table caption became as wide as document, not as wide as table). Now, they don't.

Same thing with the demo page

So, should I create a new bugfile or reopen this one?

Thank you for your understanding here,


Comment 20

11 years ago
>So, should I create a new bugfile or reopen this one?

As this is not a flaw in the patch, the patch did what it was supposed to do please open a new bug. Minimized test cases are always welcome.

It would be cool to verify that it did change with the reflow branch landing.

Comment 21

11 years ago
> please open a new bug.
For fans of this bug, visit bug 370353
Whiteboard: Visit bug 370353
You need to log in before you can comment on or make changes to this bug.