W3C home > Mailing lists > Public > www-xsl-fo@w3.org > December 2008

Centering blocks with right-aligned text

From: <temprie2000@yahoo.com>
Date: Sat, 27 Dec 2008 19:06:20 -0800 (PST)
To: www-xsl-fo@w3.org
Message-ID: <565159.61329.qm@web111110.mail.gq1.yahoo.com>


I have multiple lines of variable length text, that need to be right-aligned with respect to each other, but centered relative to the rest of the content.

Something like the following:

<-------------------- Normal block width ------------------------->

            A variable length, long line of text.
                          A shorter line of text.
                                         Line #3.

I can't use any fixed widths, as I don't know how long the lines of text will be. I have tried nesting centered/right-aligned blocks, but the nested blocks expand to align the text to the far right-hand side.  I also tried auto-sized table columns, but the text either wrapped, or overflowed to the left when white-space was set to nowrap. 

Is there an easy way to achieve the desired result without having to perform calculations on the length of the text?


Received on Sunday, 28 December 2008 18:23:50 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:32 UTC