Closed Bug 298322 Opened 20 years ago Closed 20 years ago

text-align:center IMHO wrong for tables; additionally style does not override class

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 167685

People

(Reporter: aldo, Assigned: dbaron)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Within bug 167685 you say you are right and all the other browser are wrong.
1)You say that text-align:center must not act if a table is within the
paragraph, so you don't align the table to center.
2)You say that margin-left:auto and margin-right:auto must be set in order to
align the table.


1)I think you are wrong, as from CSS1 "de facto" text-align:center is applied to
tables (I tested almost all browsers since Netscape 3.0), and your suggested use
of margin:auto do create limitatitons. 
I think that you should render:
http://www.hyperpublish.com/firedivbug/
( http://www.hyperpublish.com/firedivbug/firebug_style.css )
just like all the other browser do.


2)apart from this, I just tried the margin: auto as you suggested, by overriding
the class within the DIV tag by using the "style" keyword. This in order to
search for a workaround and to make the code automatically compatible also with
your bug.

Well, this doesn't work. See:

http://www.hyperpublish.com/firedivbug2/

The "style" tag within the DIV must override the "class" setting (this should
act as workaround on your bug; the class "s2" can not be changed as this style
is used for normal paragraphs), it does not.
I think you have actually some bad code that do translate "text-align:center" to
align=left if a table is within the paragraph, or something like.
Same for right align.

Reproducible: Always

Steps to Reproduce:
1. see url
2.
3.
margin-rigth:auto;

does it work if you spell it margin-right?
No. Just corrected and same result.
Sorry for the misaccuracy.
The auto margins are supposed to go on the table that is to be centered, not on
the container.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Sorry, but then please correct your incompatibility.
I am not going to add painful modification just to support your bug.
Since Netscape 3.0, any table contained within a DIV tag is justified just like
text.
Why on hell you do not justify?
Ok, I post the URL with a workaround.

http://www.hyperpublish.com/firedivbug3/

This means that in order for our software to be compatible also with firefox
prolix code must be added to all tables. More wasted bytes around the globe.

I still do not understand what is the reason to LEFT justify a table that is
within a DIV ALIGN=CENTER tag.
The CSS specs have been quite clear on this since CSS1.
The workaround does not work with Internet Explorer, it does toggle an error
with Internet explorer.
You're also probably better off testing browsers in standards mode, not quirks
mode.  I think a bunch agree with us in standards mode.  And the rationale for
making something a quirk is not because authors of new pages don't like it, but
because significant numbers of existing real Web pages depend on it.
I'm not testing "quirks". The code generated is the automatic code created by
EasyWebEditor, 1SITE and HyperPublish (and the old free WebSiteWord). This since
1998. They are very popular (search about "create web site" on Google and Yahoo)
even if I admit we do not have big money like Microsoft.
Our flag has always been "compatible with any browser".
There are at least 100000+ users of our products so acting "your way" makes at
least their pages not good on Firefox. 

Let's say that "formally" a text-align:center does not means a MUST for object
to be centered. It is a must only for texts.

All the other CSS implementations (I test the products on browsers since 1996)
decided that even if this was not a must, it was a "common sense" implementation
to center (or right align etc) also objects, because this more "large" or call
it "permissive" implementation was useful for backward compatibility.

IMHO the thing has 2 equally valid interpretations (yours and the other
browser's one). The problem is that yours waste millions of existing web pages -
at least all the ones created with our editors. And IMHO it costs you nothing
modify in order to be compatible with the other browsers. As you can see the
workaround that I attempted to find does work with Opera and Firefox but not
with IE 6.0.2900 (XP SP2), that does not right align (this is a bug of IE6 but
you know I've better chance to hear my cat speaking than to hear M$).
http://www.hyperpublish.com/firedivbug3/
No, it doesn't have two valid interpretations, since the CSS spec describes
exactly when blocks should be centered, and 'text-align' has no role in that
description.
(In reply to comment #9)
> I'm not testing "quirks".

Actually, you are.  The testcases you cite trigger quirks mode in most browsers
(HTML 4.01 Transitional DOCTYPE without a system identifier).  See
http://hsivonen.iki.fi/doctype/ .
The code created by the VisualVision engine is compatible with any browser
(except yours) and creates pages that are "decent" still on Netscape 2.0.
IMHO the purpose of a decent automatic editor should be that the pages should be
good on ANY BROWSER, also old browsers.

I don't want to trash backward compatibility in the name of (opinionable) new.

I understand that new browsers can read DOCTYPE - by the way it was added by us
only in 2005, so millions of web pages created with our editor don't have it.
And old browsers do ignore this. And a lot of old unix machines and old PCs
still have old browsers. We add a generic DOCTYPE as we don't want to comply to
just one specification, we always attempt to be ok for 100%. This is the reason
I am here.

Please kindly tell me where the CSS specs says that an object within a paragraph
with align CENTER or align RIGHT must be rendered with align LEFT (as you do).
IE, Opera and NS thinks the paragraph must rule and consider the table just as a
text char.
You say the CSS says that a possible mode to center is the margin:auto. However
unfortunately this specification is not so followed/enforced if Internet
Explorer (unfortunately the most used browser) does not follow it nor in 4.0 5.0
or 6.0...... see test case.

I think the figures of our users would allow at least you to fix this as "quirk"
if your opinion still is that center and right means left :).
Or any idea, as auto doesn't work with IE? We could add a checkbox "fix Firefox
align behavior".
(In reply to comment #12)
> Please kindly tell me where the CSS specs says that an object within a paragraph
> with align CENTER or align RIGHT must be rendered with align LEFT (as you do).

http://www.w3.org/TR/CSS21/visudet.html#blockwidth

I don't think enough sites actually depend on this to make it worth being a quirk.

However, if you really want this changed, the appropriate thing to do is propose
that the spec be changed, not that Mozilla be changed to disagree with the spec.
(In reply to comment #5)
> I still do not understand what is the reason to LEFT justify a table that is
> within a DIV ALIGN=CENTER tag.

I believe we center such a table.  This bug is about CSS 'text-align', not HTML
'align'.

My response in comment 13 was based on the assumption that you were referring to
'text-align', which is the subject of this bug.  HTML's align attribute should
already work as you want.
>However, if you really want this changed, the appropriate thing to do 
>is propose that the spec be changed, not that Mozilla be changed to 
>disagree with the spec.

IMHO the specs don't forbid to follow the text-align unless another alignment is
formally specified. I understand the "auto" trick proposed by you (or another
guy), but this is really non-intuitive, I would never have thinked about it.
When you want a specific alignment you explicitely ask for it, you say "align to
center" not "please set the margins in order the left and right margins are
automatic". The second sentence maybe good for a prolix politician :).



> http://www.w3.org/TR/CSS21/visudet.html#blockwidth

Sorry to be so iron-headed but this does not tell that if the block is inside a
text-align:center/right DIV paragraph then the text-align MUST not apply to the
block and MUST be ignored.
I don't want to stress you, but I can't understand your opinion. I need
something good for the automatic coding. We have users over 75 years old and we
consider a success they are not using FrontPage (prolix and compatible mostly
with IE only) :)



>HTML's align attribute should already work as you want.

Yes, this means the paradox that on old browsers the table is correctly centered
/ right aligned, while with Firefox (that's really nice, maybe I will replace
Opera he eh... :) ) it is not.

Hummm...... I think you guessed how the VV editor engine works (the basics),
each paragraph is a DIV that uses a Style (like MSWord styles) created as DIV
subclass (e.g. DIV.s1 DIV.s2 etc.). If you insert a table, it sits within the
paragraph, and it inherites margins, align etc. from the paragraph. This is how
IE, Opera, NS etc. work, since years, and IMHO this is not forbidden by the CSS
specs.
..........I have found what it seems to be a decent automatizable workaround:
http://www.hyperpublish.com/firedivbug4/
this costs at least 44 bytes for each TABLE and would make the VV code
compatible with everything.


>I don't think enough sites actually depend on this to make it worth being a 
>quirk.
...from our data there should be more than 100000 websites created by
VisualVision's EasyWebEditor, 1SITE or HyperPublish. We are quite popular.
http://www.google.com/search?q=create+web+site
Don't know if this is sufficient for you.
Additionally, as I have seen other people reported your behavior as bug, so I
think our users are not alone.

IMHO the specs don't formally forbid to follow the text-align unless another
alignment is formally specified.
(In reply to comment #15)
> IMHO the specs don't formally forbid to follow the text-align unless another
> alignment is formally specified.

Then you didn't read the spec carefully enough.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---

*** This bug has been marked as a duplicate of 167685 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → DUPLICATE
> http://www.w3.org/TR/CSS21/text.html#alignment-prop is the text-align
specification, and it does mention:
>   "A block of text is a stack of line boxes. In the case of 'left', 'right'
and 'center', this property specifies how the inline boxes within each line box
align [...]"
>
> Especially, it does not say that this property applies to non-inline boxes.

And it does not say that this property does not applies to non-inline boxes.
(((By the way I am talking about a <div> that contains ONE table and nothing
else. ))).

Here the existing approachs:

IE (IMHO bad as not CSS compliant):
-if there is a text-align, within the DIV it aligns the table according to the
align, and ignores margin:auto
( see testcase http://www.hyperpublish.com/firedivbug3 the right aligned table)
-if there is a margin-auto, and no text-align, it renders the margin auto

Firefox (IMHO bad as not backward compatible):
-if there is a margin-auto, it renders the margin auto
-if there is a text-align, it ignores it

Opera (IMHO good compromise, both CSS compliant and backward compatible):
-if there is a margin-right:auto (and/or left), it uses these settings and
ignores text-align
-if there is a text-align, it aligns the table according to the align (for
backward compatibility and IE compatibility)

Just see the various testcases and you will see.
Just for the history and to be exaustive:

- it is likely the web testcases will be transferred in the near future on
www.easywebeditor.com rather than hyperpublish.com , example:
http://www.easywebeditor.com/firedivbug etc.
I won't delete them as I hope you will think about it and will fix.

- VisualVision users/customers find more information about this problem on the
EasyWebEditor user's forum http://www.easywebeditor.com/forum/ topic
http://www.paperinik.com/cgi-bin/eng/YaBB.pl?board=EWw;action=display;num=1108818766

Aldo
You need to log in before you can comment on or make changes to this bug.