471,089 Members | 1,564 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

<COL> or <COLSPAN>

It seems these two tags don't work well, except in MSIE for PC.
See
http://mapage.noos.fr/dardelf4/LaFon...es_fables.html
with some other browser. I have tried 4 browsers for the Mac, and none
accepts to align the last two columns to the right.
Is there a way to achieve that without putting an ALIGN="right" into
every cell ?

Thanks in advance for any hint.

--
François de Dardel
http:/mapage.noos.fr/dardelf/
Faber est suae quisque fortunae
Enlever le quatorze pour m'écrire
Remove fourteen in the address to send mail

Jul 23 '05 #1
7 3168
François de Dardel <da*******@noos.fr> wrote:
It seems these two tags don't work well, except in MSIE for PC.
They work just fine in Opera and Gecko (with one exception).
See
http://mapage.noos.fr/dardelf4/LaFon...es_fables.html
with some other browser. I have tried 4 browsers for the Mac,
What were the four browsers?
and none accepts to align the last two columns to the right.

Gecko doesn't support the align attribute on <col>. This is a long
standing annoyance.
It's probably related to the fact that in CSS their are only four
properties that can be applied to columns - border, background, width
and visibility. Hence is is impossible to replicate the align
attribute of col with CSS.
http://www.w3.org/TR/CSS21/tables.html#q4
Is there a way to achieve that without putting an ALIGN="right" into
every cell ?

For that table:
td {align: left;}
td + td {align: right;}

The first line matches all table cells, the second line matches all
table cells that are siblings of a table cell and hence matches all
but the first cell in a row.

Or,
td {align: right;}
tr td:first-child {align: left;}

Which should be obvious.

Neither approach is supported by IE so you'll need to keep the aligna
ttributes for that browser.

For more complex tables such techniques can get tedious.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 23 '05 #2
In article <c3********************************@4ax.com>,
Steve Pugh <st***@pugh.net> wrote:
François de Dardel <da*******@noos.fr> wrote:
It seems these two tags don't work well, except in MSIE for PC.
They work just fine in Opera and Gecko (with one exception).
See
http://mapage.noos.fr/dardelf4/LaFon...es_fables.html
with some other browser. I have tried 4 browsers for the Mac,


What were the four browsers?
and none accepts to align the last two columns to the right.

Gecko doesn't support the align attribute on <col>. This is a long
standing annoyance.
It's probably related to the fact that in CSS their are only four
properties that can be applied to columns - border, background, width
and visibility. Hence is is impossible to replicate the align
attribute of col with CSS.
http://www.w3.org/TR/CSS21/tables.html#q4


Actually, the problem seems to be with the order in which Gecko does
it processing. It needs to figure out what alignment to use in a
table cell before it has figured out which column that cell is in.
And because the <td> element is not actually within the textual scope
of the <col> element. The technical difficulties are explained at
http://ln.hixie.ch/?start=1070385285&count=1

IE sort of supports it, but it can do so because it doesn't correctly
apply CSS rules to tables.
Is there a way to achieve that without putting an ALIGN="right" into
every cell ?

For that table:
td {align: left;}
td + td {align: right;}

The first line matches all table cells, the second line matches all
table cells that are siblings of a table cell and hence matches all
but the first cell in a row.

Or,
td {align: right;}
tr td:first-child {align: left;}

Which should be obvious.


How well does this work when rowspan and/or colspan attributes are used?
The first <td> following a <tr> could well be in the second or third
column.
Neither approach is supported by IE so you'll need to keep the align
attributes for that browser.

For more complex tables such techniques can get tedious.


--
= Eric Bustad, Norwegian bachelor programmer
Jul 23 '05 #3
ek*@hos1cad.ho.att.com (Eric Kenneth Bustad) wrote:
In article <c3********************************@4ax.com>,
Steve Pugh <st***@pugh.net> wrote:
Gecko doesn't support the align attribute on <col>. This is a long
standing annoyance.
It's probably related to the fact that in CSS their are only four
properties that can be applied to columns - border, background, width
and visibility. Hence is is impossible to replicate the align
attribute of col with CSS.
http://www.w3.org/TR/CSS21/tables.html#q4


Actually, the problem seems to be with the order in which Gecko does
it processing. It needs to figure out what alignment to use in a
table cell before it has figured out which column that cell is in.
And because the <td> element is not actually within the textual scope
of the <col> element. The technical difficulties are explained at
http://ln.hixie.ch/?start=1070385285&count=1


Hixie's explanation is telling us why CSS only allows those four
properties to be set and hence is the explanation for the explanation
that I gave.
IE sort of supports it, but it can do so because it doesn't correctly
apply CSS rules to tables.


And in this case Gecko doesn't correctly apply HTML to tables.
Remember that next time someone claims that Gecko has full HTML 4
support. ;-)

Opera manages to support the HTML align attribute and to get most of
CSS right, so it's not impossible.
td {align: right;}
tr td:first-child {align: left;}


How well does this work when rowspan and/or colspan attributes are used?
The first <td> following a <tr> could well be in the second or third
column.


IIRC, it's still the first-child of the <tr>. So yes it will fail with
row/col spanned cells. I've only ever used something like this on
simpl-ish date tables.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 23 '05 #4
Steve Pugh wrote:
ek*@hos1cad.ho.att.com (Eric Kenneth Bustad) wrote:
In article <c3********************************@4ax.com>, Steve Pugh
<st***@pugh.net> wrote:
Gecko doesn't support the align attribute on <col>.


The technical difficulties are explained at
http://ln.hixie.ch/?start=1070385285&count=1

Hixie's explanation is telling us why CSS only allows those four
properties


Hixie's article makes sense to me, but perhaps I've missed something.

IE sort of supports it, but it can do so because it doesn't
correctly apply CSS rules to tables.

And in this case Gecko doesn't correctly apply HTML to tables.
Remember that next time someone claims that Gecko has full HTML 4
support. ;-)


You've lost me. Did you mean to write that Gecko doesn't apply *CSS* to
tables?
Opera manages to support the HTML align attribute and to get most of
CSS right, so it's not impossible.


Has it solved the problem Hixie describes with CSS for col elements?

--
Brian
Jul 23 '05 #5
Brian <us*****@julietremblay.com.invalid> wrote:
Steve Pugh wrote:
ek*@hos1cad.ho.att.com (Eric Kenneth Bustad) wrote:

IE sort of supports it, but it can do so because it doesn't


And in this case Gecko doesn't correctly apply HTML to tables.
Remember that next time someone claims that Gecko has full HTML 4
support. ;-)


You've lost me. Did you mean to write that Gecko doesn't apply *CSS* to
tables?


No. I mean that Gecko doesn't support the align attribute of the <col>
element. Purely an HTML issue.
Opera manages to support the HTML align attribute and to get most of
CSS right, so it's not impossible.


Has it solved the problem Hixie describes with CSS for col elements?


Opera supports the four permitted CSS properties for columns.
It doesn't need to "solve" the "problem" - it follows the spec.

Opera supports the HTML align attribute (which Gecko doesn't) AND it
supports a CSS for tables in general, not limited to columns, rather
well (which IE doesn't).

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 23 '05 #6
On 2005-02-24 10:10:09 +0100, Steve Pugh <st***@pugh.net> said:
François de Dardel <da*******@noos.fr> wrote:
It seems these two tags don't work well, except in MSIE for PC.


They work just fine in Opera and Gecko (with one exception).
See
http://mapage.noos.fr/dardelf4/LaFon...es_fables.html
with some other browser. I have tried 4 browsers for the Mac,


What were the four browsers?

1. Safari
2. Netscape 7.1
3. MSIE 5.2 (Mac !)
4. iCab
and none accepts to align the last two columns to the right.


--
François de Dardel
http:/mapage.noos.fr/dardelf/
Faber est suae quisque fortunae
Enlever le quatorze pour m'écrire
Remove fourteen in the address to send mail

Jul 23 '05 #7
Eric Kenneth Bustad wrote:

In article <c3********************************@4ax.com>,
Steve Pugh <st***@pugh.net> wrote:
>François de Dardel <da*******@noos.fr> wrote:
>
>>It seems these two tags don't work well, except in MSIE for PC.

>
>They work just fine in Opera and Gecko (with one exception).
>
>>See
>> http://mapage.noos.fr/dardelf4/LaFon...es_fables.html
>>with some other browser. I have tried 4 browsers for the Mac,

>
>What were the four browsers?
>
>>and none accepts to align the last two columns to the right.

>
>
>Gecko doesn't support the align attribute on <col>. This is a long
>standing annoyance.
>It's probably related to the fact that in CSS their are only four
>properties that can be applied to columns - border, background, width
>and visibility. Hence is is impossible to replicate the align
>attribute of col with CSS.
> http://www.w3.org/TR/CSS21/tables.html#q4


Actually, the problem seems to be with the order in which Gecko does
it processing. It needs to figure out what alignment to use in a
table cell before it has figured out which column that cell is in.
And because the <td> element is not actually within the textual scope
of the <col> element. The technical difficulties are explained at
http://ln.hixie.ch/?start=1070385285&count=1

IE sort of supports it, but it can do so because it doesn't correctly
apply CSS rules to tables.
>>Is there a way to achieve that without putting an ALIGN="right" into
>>every cell ?

>For that table:
>td {align: left;}
>td + td {align: right;}
>
>The first line matches all table cells, the second line matches all
>table cells that are siblings of a table cell and hence matches all
>but the first cell in a row.
>
>Or,
>td {align: right;}
>tr td:first-child {align: left;}
>
>Which should be obvious.


How well does this work when rowspan and/or colspan attributes are used?
The first <td> following a <tr> could well be in the second or third
column.
>Neither approach is supported by IE so you'll need to keep the align
>attributes for that browser.
>
>For more complex tables such techniques can get tedious.


With Gecko browsers (Mozilla, Firefox, Netscape), this is one of
the oldest bugs. See
<URL:https://bugzilla.mozilla.org/show_bug.cgi?id=915>. Since it
was written in 1998, approximately 65 other Mozilla bugs have been
closed as duplicates of bug #915.

One holdup blocking a fix was a lack of consensus on how to
interpret the HTML 4.01 specification that relates to this bug.
That may have been resolved. However, the last attempted fix
(November) didn't seem to work.

In the end, this is not considered something that is inherent in
Gecko browsers. Instead, it is recognized as a bug. Efforts are
being made to fix it.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Jul 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Neil Zanella | last post: by
11 posts views Thread by Woolly Mittens | last post: by
reply views Thread by EasyRider41 | last post: by
7 posts views Thread by | last post: by
36 posts views Thread by Roedy Green | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.