W3C home > Mailing lists > Public > www-style@w3.org > June 2006

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

From: Dave Raggett <dsr@w3.org>
Date: Thu, 1 Jun 2006 11:40:03 +0100 (BST)
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-style@w3.org
Message-ID: <Pine.LNX.4.62.0606011113490.8882@localhost.localdomain>

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: "." }



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)

Version: GnuPG v1.4.1 (GNU/Linux)

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:24 UTC