The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in Future

Status

()

Core
Layout: Tables
P3
normal
RESOLVED FIXED
16 years ago
10 years ago

People

(Reporter: Martin Honnen, Unassigned)

Tracking

({css2, testcase})

Trunk
Future
css2, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: Visit bug 370353)

Attachments

(2 attachments)

(Reporter)

Description

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

<html>
<head>
<title>col test</title>
</head>
<body>
<input type="button" value="toggle column visibility"
       onclick="with (document.getElementById('aCol').style)
                 if (visibility == '')
                   visibility = 'collapse';
                 else
                   visibility = '';"
/>
<table border="1">
<col id="aCol"
     style="background-color: blue;" 
     onmouseover="alert(event.type + ' for ' + event.target);"
>
<col style="background-color: red;">
<thead>
<tr>
<th>
Name
</th>
<th>
Home
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Kibo
</td>
<td>
<a href="http://www.kibo.com">http://www.kibo.com</a>
</td>
</tr>
</tbody>
</table>
</body>
</html>
(Reporter)

Comment 1

16 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

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

Comment 6

16 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

16 years ago
Moving to m0.1.0.1
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0.1

Comment 9

16 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

15 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 http://syntheticdimension.net/test4.html
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 http://syntheticdimension.net/test4a.html 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.

Updated

15 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

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

Updated

14 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

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

Comment 17

13 years ago
fixed by checkin for bug 77019
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED

Comment 18

10 years ago
+CC: bernd_mozilla@gmx.de

Comment 19

10 years ago
Bernd, 

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

http://www.gtalbot.org/DHTMLSection/TableRowColumnCollapse.html

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

Thank you for your understanding here,

Gérard

Comment 20

10 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

10 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.