You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by David Lowell <da...@zedak.com> on 2002/08/08 16:18:09 UTC
Right-aligning page numbers in a table of contents in an XSL:FO document.
I'm trying to right-align page numbers in an XSL:FO table of contents,
regardless of how many digits are in the page number. I've had problems
where I can't right-align both one- and two-digit numbers because the
one-digit numbers are padded on the right. For example:
ENTRY......1
ENTRY......5
ENTRY......10
I finally fixed the problem by adding a TOC entry as a two-cell table row,
where the page number cell is right-aligned. The sample below contains a
hard-coded page number of "10".
<fo:table-row>
<fo:table-cell text-align-last="justify">
<fo:block>TOC ENTRY<fo:leader leader-pattern="dots" /></fo:block>
</fo:table-cell>
<fo:table-cell text-align="right">
<fo:block text-align="right">10</fo:block>
</fo:table-cell>
</fo:table-row>
The problem is this doesn't work when the page number is replaced with an
"fo:page-number-citation" command. For example, if I replaced the "10"
above with <fo:page-number-citation ref-id="toc0" />, the page number would
be printed to the right of the table cell.
Why is this? Is there any way to fix it?
David Lowell
Zedak Corp.