Centering blocks with right-aligned text

Hi,

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?

Thanks,
Abe




      

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