xsl-list
[Top] [All Lists]

[xsl] Decimal alignment using fo:leader

2007-08-22 16:01:41
I'm sure someone smarter than I am has already solved this....

I'm trying to align data in an fo:table on the decimal point, with the value 
having the greatest precision right-aligned.    All of the examples I have 
found show fixed width, only.  

How do you do this when you don't know the size of the font, or the width of 
the column?

I've tried to calculate the leader-length, but I'm not having any luck getting 
it to right align. How could I change this to make it work?

This is what I have:

<fo:table-cell column-number="4" border=".1mm solid black"
    padding-start="5%" padding-before="2pt" padding-end="5%">
    <fo:block text-align="right" font-size="8pt">  52<fo:leader
        leader-pattern="use-content" leader-length="<<$max-precision=5>>* 
inherited-property-value(font-size)"
        leader-pattern-width="<<$max-precision=5>> * 
inherited-property-value(font-size)">.50000</fo:leader>
    </fo:block>
</fo:table-cell>

<fo:table-cell column-number="4" border=".1mm solid black"
    padding-start="5%" padding-before="2pt" padding-end="5%">
    <fo:block text-align="right" font-size="8pt">  10<fo:leader
        leader-pattern="use-content"
        leader-length="<<$max-precision=5>> * 
inherited-property-value(font-size)"
        leader-pattern-width="<<$max-precision=5>> * 
inherited-property-value(font-size)">.38</fo:leader>
    </fo:block>
</fo:table-cell>

This gives me (assume a border-bottom in the fo:block within the last row):
+-------------------+
|     52.50000      |
|     10.38         |
| ----------------  |
+-------------------+

But I need:
+-------------------+
|         52.50000  |
|         10.38     |
| ----------------  |
+-------------------+

Thanks in advance!
Angela Williams 
Software Developer
The 401k Company, A Charles Schwab Company
98 San Jacinto Blvd. ~ Suite 1100 ~ Austin, TX 78701 
Office: 512.344.1547 ~ Fax: 512.397.6656
Angela(_dot_)Williams(_at_)The401kCompany(_dot_)com    
 


--~------------------------------------------------------------------
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>
--~--