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>
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
Table layout problem, over to karnaze.
And 'hidden' doesn't work, it only removes the background-color!
the border-collapsing code is currently disabled. Please see bug 41262
This bug is about column-collapsing, not border-collapsing. Not the same thing.
Moving to m0.1.0.1
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
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.
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.
mass reassign to default owner
"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.
fixed by checkin for bug 77019
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
>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.
> please open a new bug. For fans of this bug, visit bug 370353