Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

align="char" question

4 views
Skip to first unread message

Ian Rutgers

unread,
Oct 9, 2002, 5:14:54 PM10/9/02
to
In trying to expand my html/xhtml knowledge I was fooling around with the
align="char" char="." attributes of <col>. In all the examples I tried,
including the one on the w3.org site (as below and on
http://www.w3.org/TR/1998/REC-html40-19980424/struct/tables.html#adef-charof
f)

<TABLE border="1">
<COLGROUP>
<COL><COL align="char" char=".">
<THEAD>
<TR><TH>Vegetable <TH>Cost per kilo
<TBODY>
<TR><TD>Lettuce <TD>$1
<TR><TD>Silver carrots <TD>$10.50
<TR><TD>Golden turnips <TD>$100.30
</TABLE>

The items in the column do not align on the ".". Anyone ever tried this/had
any luck? Did not see this in the FAQ's (though it is possible my glasses
were dirty).

Thanks,

Ian


Jukka K. Korpela

unread,
Oct 9, 2002, 5:27:12 PM10/9/02
to
"Ian Rutgers" <irut...@yahoo.com> wrote:

> The items in the column do not align on the ".". Anyone ever tried
> this/had any luck?

The align="char" attribute is poorly if at all supported.

This has been discussed fairly often, and various workarounds have been
suggested - nothing really good, but something you might wish to
consider. See e.g. the discussions
http://groups.google.com/groups?th=9fa138ae54c4cbc9&rnum=1
http://groups.google.com/groups?th=c2ae11a7af209f2a&rnum=1
http://groups.google.com/groups?th=de83a51e9c5e886e&rnum=4

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Lawrence Edwards

unread,
Oct 9, 2002, 5:39:58 PM10/9/02
to


I remember trying this myself a while back. To my disappointment, it
didn't work on any of the browsers I tested.

--
Lawrence Edwards
http://www.velvetant.org

n00b

unread,
Oct 9, 2002, 9:16:55 PM10/9/02
to
why don't you just right-align the numbers and always use 2 decimal places?
that should do it, right?

"Lawrence Edwards" <nos...@nospam.net> wrote in message
news:3DA4CB80...@nospam.net...


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002


Jim Dabell

unread,
Oct 10, 2002, 12:37:56 PM10/10/02
to
n00b wrote:
[rearranged top-posting]
[snip]

>> Ian Rutgers wrote:
>> > In trying to expand my html/xhtml knowledge I was fooling around with
> the
>> > align="char" char="." attributes of <col>. In all the examples I
>> > tried, including the one on the w3.org site (as below and on
>> >
[snip]

>
> why don't you just right-align the numbers and always use 2 decimal
> places? that should do it, right?

Almost. When displayed in a proportional font, some digits are wider than
others. For instance, 1 is not going to be as wide as 6.

--
Jim Dabell

Ian Rutgers

unread,
Oct 10, 2002, 2:06:34 PM10/10/02
to

"Jukka K. Korpela" <jkor...@cs.tut.fi> wrote in message
news:Xns92A346623ED3...@193.229.0.31...
Took a look ... glad see to I wasn't missing something with my coding ..
sorry that the big guys added this capability to their browsers yet .. would
make some coding cleaner!

Thanks for the confirmation,

Ian


n00b

unread,
Oct 10, 2002, 2:32:58 PM10/10/02
to
yeah, you're right. good point.

i did remember seeing it somewhere and did a quick search. i found this:
http://www.w3.org/MarkUp/html3/tables.html

it uses <tr align=decimal dp=":"> to line up by the ":". perhaps that'll
work (haven't tried myself).


"Jim Dabell" <jim-u...@jimdabell.com> wrote in message
news:KEOdnXzQY9A...@News.GigaNews.Com...

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).

Version: 6.0.400 / Virus Database: 226 - Release Date: 10/9/2002


Karl Smith

unread,
Oct 10, 2002, 2:41:34 PM10/10/02
to
Ian Rutgers wrote:

[the align to char attribute of tables is unimplemented]

n00b wrote:

>>why don't you just right-align the numbers and always use 2 decimal
>>places? that should do it, right?

Jim Dabell wrote:

> Almost. When displayed in a proportional font, some digits are wider than
> others. For instance, 1 is not going to be as wide as 6.

If you know that a table will be only numeric data, is a monopsaced font
appropriate? Any of the typographically inclined posters care to comment
on readability of proportional vs monospaced fonts, where numbers are
concerned?


--
happy:after {
content: " :-) "
}

Ian Rutgers

unread,
Oct 10, 2002, 3:04:44 PM10/10/02
to

"n00b" <an...@anon.com> wrote in message
news:uJjp9.3445$Bo.5...@twister.nyc.rr.com...

> yeah, you're right. good point.
>
> i did remember seeing it somewhere and did a quick search. i found this:
> http://www.w3.org/MarkUp/html3/tables.html
>
> it uses <tr align=decimal dp=":"> to line up by the ":". perhaps that'll
> work (haven't tried myself).
>
>
I tried, doesn't align on the ":" 8-(


Paul Williams

unread,
Oct 11, 2002, 2:42:05 AM10/11/02
to
Jim Dabell wrote:

>
> n00b wrote:
> >
> > why don't you just right-align the numbers and always use
> > 2 decimal places? that should do it, right?
>
> Almost. When displayed in a proportional font, some digits are
> wider than others. For instance, 1 is not going to be as wide as 6.

Lining figures in a typeface are usually the same width as each other.
Most of the typefaces you use contain lining figures (ie. the ones that
are the same height, as opposed to old style figures).

- Paul

0 new messages