W3C home > Mailing lists > Public > www-xsl-fo@w3.org > September 2003

Re: text-align vs text-align-last

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Tue, 23 Sep 2003 06:37:33 -0400
Message-Id: <>
To: <www-xsl-fo@w3.org>

At 2003-09-23 13:04 +0300, Victor Vishnyakov wrote:
>Is "text-align-last" has higher priority over "text-align" or not?
>  ...
>     <fo:block border="1px" margin="10px" text-align="left" 
> text-align-last="right">text-align="left" text-align-last="right"</fo:block>
>    </fo:block>
>FOP and Ibex aligned text to the left side of the page

That is not correct behaviour.

>XEP and XSLFormatter aligned text to the right side

That is correct behaviour.

>The question: which alignation should be used for the 1-line blocks if 
>"text-align" is not the same to "text-align-last"

text-align-last= only applies to the last line in a block and a 1-line 
block is considered the last line for justification (note that it is also 
considered the first line for other things like text-indent=, 
<initial-property-set>, etc.).

>and why?

Think about paragraph printing in a newspaper or in a novel:  You read a 
long 7-line paragraph and the first 6-lines are justified side-to-side, the 
last line is not justified and just ends in the middle of the line.

The next paragraph is short at, say, only 5 words ... would you expect 
those words to be justified from side to side?  Nope!  You would expect it 
to be short, just like the last line of a multiple line block.

The nuance about this issue is the use of justify ... if you use anything 
other than justify, say "center" or "end", it applies to all lines of the 
block.  But if you use "justify" it *doesn't* apply to the last line of the 
block, for the reasons described above.

If you wanted the entire block to be justified side to side (and you *do* 
when doing entries in tables of content that have leaders on the last line) 
you have to specify *both* text-align= and text-align-last=.

I now see that David has quoted chapter and verse, but I hope this 
description also helps.

...................... Ken

Next public US delivery:        3-day XSLT/2-day XSL-FO 2003-10-13
Next public European delivery:  3-day XSLT/2-day XSL-FO 2003-11-??
Instructor-led on-site corporate, government & user group training
for XSLT and XSL-FO world-wide:  please contact us for the details

G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                       Definitive XSLT and XPath
ISBN 0-13-140374-5                               Definitive XSL-FO
ISBN 1-894049-08-X   Practical Transformation Using XSLT and XPath
ISBN 1-894049-11-X               Practical Formatting Using XSL-FO
Member of the XML Guild of Practitioners:     http://XMLGuild.info
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/f/bc
Received on Tuesday, 23 September 2003 06:37:45 UTC

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