xsl-list
[Top] [All Lists]

Re: [xsl] XSL-FO alignment

2006-05-03 17:32:10
At 2006-05-04 00:09 +1000, Kamal Bhatt wrote:
I have the following XSL-FO script:

(thank you for providing a complete file)

      <fo:block font-family="Courier" font-size="10pt" space-before="6pt"
space-after="6pt" text-align="left"
                border-style="solid" border-width="0.25pt"
                padding-left="4pt" padding-right="4pt" padding-top="6pt"
padding-bottom="6pt" line-height="15pt">

According to XSL-FO 1.0 Section 5.3.2, your specification above will draw the border *outside* of the parent boundary limits ... unlike CSS. This guarantees that the text of the border block lines up with the text of an adjacent unbordered block. If you wanted the border to line up with the text, use margin-left="0pt" in addition to your other properties.

Firstly, I would am still confused about the difference between
space-before and padding-before and padding-top. If someone could explain
that to me, that would be great.

The space-before= property defines the space between the adjacent block area and the area's border rectangle (which is the outside edge of the border).

The padding-before= and padding-top= both specify the distance between the area's padding rectangle (which is the inside edge of the border) and the area's content rectangle. The only difference between padding-before= and padding-top= is that the use of writing-direction-dependent values of before/after/start/end are portable across different languages while the CSS heritage top/bottom/left/right are biased to left-to-right/top-down writing directions.

Both spacing and padding are in play since they define different concepts.

Secondly, I would like the table aligned with the border of block before
it.

Then add margin-left="0pt" to ensure that the border does not "push out" such that its context text aligns with the text of neighbouring blocks.

I am using the version of FOP that comes with cocoon-2.1.9. Thanks.

I never use FOP so I don't have it to test my suggestion, but that suggestion works with other formatters.

I hope this helps.

. . . . . . . . . Ken

--
Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16
Also for XSLT/XSL-FO training:    Minneapolis, MN 2006-07-31/08-04
Also for XML/XSLT/XSL-FO training:Birmingham,England 2006-05-22/25
Also for XSLT/XSL-FO training:    Copenhagen,Denmark 2006-05-08/11
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>