W3C home > Mailing lists > Public > www-style@w3.org > August 2014

[css4-text] text-align: auto

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Fri, 1 Aug 2014 14:10:58 +0200
Message-Id: <DCC62A6E-9E4B-476B-BA98-30E3C52E3ECF@crissov.de>
To: www-style list <www-style@w3.org>
Spreadsheet applications support automatic text alignment in cells. That means numeric values are right-aligned and everything else is left-aligned (or rather start-aligned). This is the default behavior. CSS has nothing like this, character alignment, which isn’t implemented much, probably comes closest.

I’d like to propose an ‘auto’ value for the ‘text-alignment’ property. It would work like this:
If there are only textual/inline children and if these only contain digit, punctuation and space characters calculate to ‘right’ (‘end’?), but as soon as another type of characters is encountered calculate to ‘start’, otherwise calculate to ‘justify’ (i.e. with block children). This latter fallback differs from spreadsheets.
This behavior may be limited to certain boxes, e.g. those with ‘display’ set to ‘table-cell’ and certain others.

Please note that ‘text-align-last’ already supports an ‘auto’ value, so maybe a different name would be preferable.
Received on Friday, 1 August 2014 12:11:28 UTC

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