Closed
Bug 94798
Opened 24 years ago
Closed 22 years ago
<td> in a nested table not aligned correctly
Categories
(Core :: Layout: Tables, defect)
Tracking
()
RESOLVED
WONTFIX
mozilla1.2alpha
People
(Reporter: diego, Assigned: hyatt)
References
()
Details
(Keywords: testcase, Whiteboard: need feedback from HTML WG?)
Attachments
(4 files)
The nested table on the page (the one with the red border) is not rendered
correctly. The third column has center alignment, although HTML 4.01 defines
left alignment as default for table data. See
http://www.w3.org/TR/html4/struct/tables.html#alignment
Reporter | ||
Comment 1•24 years ago
|
||
Netscape 4.77, opera and IE render this correctly,the code validates.
I have reduced the code to a testcase that illustrates the problem. The text on
the right should have left alignment.
Reporter | ||
Comment 2•24 years ago
|
||
Comment 3•24 years ago
|
||
Comment 4•24 years ago
|
||
I trimmed out a bit more stuff.
It looks like the <td> in the inner table is picking up characteristics from the
<th> in the outer table. Change the outer table cell to <td> instead of <th>,
and the inner cell shows as left-aligned, as expected.
I'll leave the issue of what it's *supposed* to do to those who know the HTML
specs better than me...
Reporter | ||
Comment 5•24 years ago
|
||
Gavin, you trimmed out a little too much.. Try putting an align=something into
your code, nothing happens, neither in mozilla nor in netscape 4.77.
Comment 6•24 years ago
|
||
It is happening, it's just not very visible :-( I've made a revised one where
it's more obvious.
Comment 7•24 years ago
|
||
Reporter | ||
Comment 8•24 years ago
|
||
Sorry Gavin, my fault, your testcase does work (both of them in fact) resizing
my mozilla window did wonders...
I am confirming this bug --> NEW
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 9•24 years ago
|
||
hyatt, do you know how it is supposed to behave using loose.dtd.
Assignee: karnaze → hyatt
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.4
Assignee | ||
Comment 10•24 years ago
|
||
Change your doctype line to this...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
That will put you into Nav's quirks mode, which will fix the problem. The
extra loose.dtd stuff seems to lead us to believe we're in strict mode instead.
cc'ing dbaron.
dbaron, looking at the specified doctype in the testcase, should we be treating
it as quirks or standard mode? We seem to be changing our answer because of
the DTD specification portion.
Basically this bug seems invalid, since in strict mode we should inherit text-
align as well as font-weight into nested tables, right?
Assignee | ||
Updated•24 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Assignee | ||
Comment 11•24 years ago
|
||
Ok, appears invalid. See the following page for documentation. Apparently the
addition of "loose.dtd" puts us into standards mode rather than quirks mode.
If you omit it, you'll get quirks mode, and it will work the way you desire.
http://www.hut.fi/~hsivonen/doctype.html
Yeah, although the check for "loose.dtd" is really bad. The only thing about
the system identifier in the doctype declaration that we should depend on is
whether it is there or not. Maybe I actually will rewrite our doctype parsing
code sometime (or revive the rewrite that rickg didn't want). There are
multiple bugs on the issue, I'm just too lazy to find the numbers right now...
Reporter | ||
Comment 13•24 years ago
|
||
I beg to differ. This bug is not invalid. It's not about fixing a webpage. it's
about fixing mozilla.
Let's see what the standard says:
(cut and paste from http://www.w3.org/TR/html401/struct/tables.html#h-11.3.2)
align = left|center|right|justify|char [CI]
This attribute specifies the alignment of data and the justification of text
in a cell. Possible values:
* left: Left-flush data/Left-justify text. This is the default value for
table data.
So align=left is the default for <td> and mozilla assumes align=center and in
doing so is the only browser on the planet that violates the standard on this
particular issue.
Going back to quirks mode is clearly not the solution for a webpage that sports
the W3C html 4.01 logo. In standards mode we should adher to the standards.
The bug is real and it's on our side --> REOPEN
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Comment 14•24 years ago
|
||
Correct.
Even in 4.01 strict mode align for <td> & <th> is valid and Mozilla should thus
be following the spec and it's a bug if it doesn't.
The system identifier on the DOCTYPE declaration should play no relevance what
so ever.
But what about http://www.w3.org/TR/html4/struct/tables.html#h-11.3.2.1 , when
combined with the CSS inheritance rules?
Assignee | ||
Comment 16•24 years ago
|
||
Still seems invalid to me. In strict mode, the default is to left-align a table
cell, but only if a parent doesn't specify a specific alignment (thus causing
that alignment to be inherited). In this case, the <th> has a center alignment
and that inherits in to the <td> in the nested table.
Quirks mode cuts off alignment and prevents inheritance. I don't think
standards mode should do this. I don't see this as contradicting the HTML4 spec.
Status: REOPENED → ASSIGNED
Reporter | ||
Comment 17•24 years ago
|
||
Good point, but I think the bug is still valid.
I am quoting the recommendation for easy reference:
The alignment of cell contents can be specified on a cell by cell basis, or
inherited from enclosing elements, such as the row, column or the table itself.
The order of precedence (from highest to lowest) for the attributes align, char,
and charoff is the following:
1. An alignment attribute set on an element within a cell's data (e.g., P).
2. An alignment attribute set on a cell (TH and TD).
3. An alignment attribute set on a column grouping element (COL and
COLGROUP). When a cell is part of a multi-column span, the alignment property is
inherited from the cell definition at the beginning of the span.
4. An alignment attribute set on a row or row grouping element (TR, THEAD,
TFOOT, and TBODY). When a cell is part of a multi-row span, the alignment
property is inherited from the cell definition at the beginning of the span.
5. An alignment attribute set on the table (TABLE).
6. The default alignment value.
The problematic paragraph is 2. and the question is: Does the alignment of <th>
get inherited into a nested table?
I would say no, but the issue is tricky. FWIW, all the other browsers seem to
share my interpretation. So if it is open to interpretation, why not keep in
line with the others...
Is there some kind of final arbiter (at the W3C or wherever) for this kind of
question?
Assignee | ||
Comment 18•24 years ago
|
||
This seems ambiguous, since it's a question of how CSS inheritance interacts
with what's specified in the HTML spec.
Sounds like it needs to be raised with the CSS or HTML WG. The basic question
is whether or not to reset text-align on table, e.g.,
table {
text-align: start;
}
Assignee | ||
Comment 19•24 years ago
|
||
Assignee | ||
Comment 20•23 years ago
|
||
need more time to collect feedback, decide if this is a good patch, etc.
Target Milestone: mozilla0.9.4 → mozilla0.9.5
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Comment 21•23 years ago
|
||
changing keywords, etc.
Comment 22•23 years ago
|
||
In strict mode, where all presentational attributes and elements are supposed to be
invalid (and would be if at the time of the spec's release it was thought that CSS
could handle all the relevant presentations), CSS should completely override HTML
as far as presentation rules go. HTML is a vocab spec, not a presentational spec.
At least, that's my opinion. :-)
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.6 → mozilla1.0
Reporter | ||
Comment 23•23 years ago
|
||
Hyatt, I finally got around to building a lizard with your patch applied to it.
It now renders the page fine. No problems so far. I will use this build for my
daily surfing for a few days and report back if any pages get rendered strangely.
Assignee | ||
Comment 24•23 years ago
|
||
Thanks, diego. I'm inclined to check this change in. It seems safe, but
testing would be welcome.
Reporter | ||
Comment 25•23 years ago
|
||
No apparent problems with the patch so far.
News on the browser front: I just tried IE6 to round up the info about the
competition and lo and behold, it renders the page like mozilla...
So we have:
left alignment: NN4, Opera, IE5
center alignment: mozilla, IE6
What do we do now? Let the HTML WG decide, check in the patch or stick to
default behavior?
Comment 26•23 years ago
|
||
->099
Summary: <td> in a nested tabled not aligned correctly → <td> in a nested table not aligned correctly
Target Milestone: mozilla1.0 → mozilla0.9.9
Reporter | ||
Comment 27•23 years ago
|
||
Just tried amaya 5.2 under linux and it displays the page with left alignment.
New browser statistics:
left alignment: NN4, Opera, IE5, amaya
center alignment: mozilla, IE6
Reporter | ||
Comment 28•23 years ago
|
||
The page has been modified to be left aligned explicitly, but the testcases
still work. Just tried Opera 6 under Linux, also renders the testcases with
left alignment.
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.9 → mozilla1.2
Reporter | ||
Comment 29•22 years ago
|
||
This should be settled once and for all, even if it should be WONTFIX. Hixie,
you sound like someone who might take a decision on this..
Attachment #46620 -
Flags: review?(ian)
Comment 30•22 years ago
|
||
Comment on attachment 46620 [details] [diff] [review]
Patch that ensures text-align is reset even in standards mode
I don't see why we'd want to do this.
Attachment #46620 -
Flags: review?(ian) → review-
Comment 31•22 years ago
|
||
thanks hixie for the clarification :-)
Status: ASSIGNED → RESOLVED
Closed: 24 years ago → 22 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•