Re: [css4-text] text-align: auto

On 08/01/2014 01:10 PM, Christoph Päper wrote:
> 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.

This seems reasonable, but it's a bit more complicated than you say:
for example, there are various units that use letters, that should
also be right-aligned.

It's a nice idea, but probably not something that's a high priority
to address right now.

~fantasai

Received on Sunday, 3 August 2014 18:07:16 UTC