Borders collapse when rules="all" is declared

RESOLVED FIXED in mozilla1.8beta2



17 years ago
9 years ago


(Reporter: bugzilla, Unassigned)


(Blocks: 1 bug, {testcase})

Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [patch])


(5 attachments)



17 years ago
The default value for border-collapse is separate. If you add the attribute
rules="all", then the value of border-collapse becomes collapse; a given value
to cellspacing is ignored.
Opera 6 (O6 does not support the rules attribute anyway) and MSIE 6 do not react
this way.

Comment 1

17 years ago
Created attachment 90028 [details]
Table borders collapsing when rules="all" is declared
Agreed, that seems bad for rules="all" mapping.  I'll try to remember to get to
this when I work on the other bug I own about cleaning up the code so it doesn't
use PostResolveCallbacks.
Ever confirmed: true
Priority: -- → P2
Target Milestone: --- → Future


17 years ago
Keywords: testcase

Comment 3

17 years ago
This is being caused by the rule:
table[rules] {
  border-collapse: collapse;
in html.css

Comment 4

16 years ago
> This is being caused by the rule... in html.css.

So then, this could be fixed by adding
table[rules="all"] {
  border-collapse: separate;
OS: Windows XP → All
Hardware: PC → All

Comment 7

16 years ago
I don't even understand why one would want to declare a css rule where the
[rules] selector determines somehow the border-collapse property value of a
table. That, I don't understand.
MSIE 6 does not work like that.

Comment 8

16 years ago
Created attachment 101609 [details]
rules=cols demonstration for IE

Borders on rows and columns have no effect in the separated borders model.
That's why we need to use the collapsed borders model for tables with 'rules'.

What MSIE is doing here is, I think, not actually possible in CSS. (And you
can't do it with CSS in MSIE, either.) In a table with rules=cols, the vertical
borders are painted *into* the cellspacing to connect them from cell to cell.

Comment 9

16 years ago
Re comment #8
So, this quote [ from ]
should be decisive:
"In this (separated border) model, each cell has an individual border. (...)
Rows, columns, row groups, and column groups cannot have borders (i.e., user
agents must ignore the border properties for those elements)."

So in other words:
1) table[rules="all"] implies border-collapse:separate
2) table[rules="cols"] implies border-collapse:collapse
3) table[rules="rows"] implies border-collapse:collapse
4) table[rules="groups"] implies border-collapse:collapse
5) table[rules="none"] implies border-collapse:collapse (?!?)

Did I get this right?

So, this bug could be solved by modifying html.css with these css3 attribute
table[rules*="o"] {border-collapse:collapse;} 
/* every rules that has a value with the substring "o" at least once */
table[rules]:not([rules="all"]) {border-collapse:collapse;}
/* all of the rules values except when rules="all" */
table[rules="all"] {border-collapse:separate;}

   table[rules]:not([rules="all"]) {border-collapse:collapse;}

...would also match table with no rules attribute. Better would be to list the
values intended to affect border-collapse.

Anyway, this can't be done in html.css since it needs to be considered as author
level style (it's a presentational attribute) so it must be done at the
attribute mapping level.
Created attachment 101843 [details]
IE6 rendering of "Testcase"
I'm against the idea that any of the values for the HTML attribute 'rules'
should imply 'border-collapse:collapse'. If the author hasn't explicitly
specified 'collapse' it should be 'separate', after all what would you do when
the author explicitly have style="border-collapse:separate" and rules="all" ?

I think the IE6 implementation of "separate rules" is excellent and in spirit
with the HTML spec regarding 'rules' (see attachment 101843 [details].)
IMHO, that is the rendering we should implement too.

Comment 14

16 years ago
Mats, what do you make of this which can be read at section 17.6.1 of CSS2 and

"In this (separated border) model, each cell has an individual border. (...)
Rows, columns, row groups, and column groups cannot have borders (i.e., user
agents must ignore the border properties for those elements)."

Toward the end of section 17.6.2 of CSS2 and CSS2.1, the W3C give an example of
a table with rules="rows"; the border-collapse:collapse declaration is
explicitly stated to achieve that.

{The top border of the table is set to 'hidden' to suppress the top border of
the first row. This implements the "rules" attribute of HTML 4.0 (rules="rows").

TABLE[rules=rows] TR { border-top: solid }
TABLE[rules=rows]    { border-collapse: collapse; 
                       border-top: hidden }

Comment 15

16 years ago
*** Bug 187258 has been marked as a duplicate of this bug. ***

Comment 16

16 years ago
*** Bug 188883 has been marked as a duplicate of this bug. ***

Comment 17

16 years ago
*** Bug 199573 has been marked as a duplicate of this bug. ***
Comment on attachment 139525 [details] [diff] [review]

Attachment #139525 - Flags: superreview?(bz-vacation) → superreview+

Comment 20

15 years ago
Borders still have broken styles for cols, rows and groups. Why?

I have a table with <colgroup span=2>, <td colspan=2> and <td rowspan=2>  and
simply want to have it looking the same way as simple tables. Without any CSS
hacks if possible.

On IE it works as expected

Comment 21

15 years ago
Comment on attachment 139525 [details] [diff] [review]

this will probably still match rules="", but it fixes this bug, which is for me
more a reaction to public pressure than content driven.
Attachment #139525 - Flags: review?(bernd.mielke) → review+


15 years ago
Blocks: 56362

Comment 22

14 years ago
Why was this never checked in?
This was assigned and a patch was made. Why wasn't it checked in?

Status update anyone? Ian, David?
Comment on attachment 139525 [details] [diff] [review]

Attachment #139525 - Flags: approval1.8b2? → approval1.8b2+
Fix checked in to trunk, 2005-04-28 13:47 -0700.
Last Resolved: 14 years ago
Resolution: --- → FIXED
Target Milestone: Future → mozilla1.8beta2
The rules="all" part of this got backed out because it caused bug 310100.  It
looks like we need to get bug 43178 fixed...
Depends on: 43178
Resolution: FIXED → ---

Comment 27

9 years ago
bug 43178 got fixed the test case is
Last Resolved: 14 years ago9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.