Re: aligning a column of numbers on the decimal point?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 1 Jun 2006, Daniel Glazman wrote:

> Dave Raggett wrote:
>
>> Any new feature takes effort to implement and test, so the question
>> is really what level of demand there is for decimal aligment on
>> the Web?  This list may not be the best place to ask, but it is a
>> start.
>
> Dave, the text-align property on table cells was supposed to do
> that. See section 17.5.4 of CSS 2 spec.
>
> </Daniel>

Thanks for the pointer.

CSS2 specified the use of strings with text-align, e.g.

     td { text-align: "." }

see:

   http://www.w3.org/TR/CSS2/tables.html#column-alignment

But this doesn't seem to have been widely implemented, e.g.
Firefox 1.5 reports: "Error parsing value for property
'text-align'. Declaration dropped.

And the feature is not present in the CSS 2.1 spec.

The way it is specified in CSS 2 is fine. The lack of an explicit 
means to specify the offset of the vertical alignment axis with 
respect to the edge of a column box is a minor problem. A work 
around would be to adjust the horizonal margin or padding values.

Decimal alignment makes numbers look neater and easier to read,
and it would be great to have this feature implemented, but
that depends on the level of interest.

In the meantime, developers can hack around the lack of decimal 
alignment by using fixed pitch fonts and inserting an appropriate 
number of non breaking spaces before each number.


  Dave Raggett <dsr@w3.org>  W3C lead for multimodal interaction
  http://www.w3.org/People/Raggett +44 1225 866240 (or 867351)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEfsQIb3AdEmxAsUsRAmI5AJ983Gs0vi2ZpVr4E1OOkiaSMbhaIwCfWzug
sjpYNMxf9tWscedTAdCt9pc=
=+olW
-----END PGP SIGNATURE-----

Received on Thursday, 1 June 2006 10:40:20 UTC