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

XSL-FO Decimal Alignment

From: <hostyt@Nationwide.com>
Date: Thu, 19 Jun 2003 09:19:46 -0400
To: www-xsl-fo@w3.org
Message-ID: <OF2D2E6ED6.4E8904AF-ON85256D4A.0048C292-85256D4A.00493921@nwie.net>

I have a table with two columns.  I'd like all of the values in the columns
to align in the center of the cell, so all the decimals line up.

ex.
10.0
100.0
1000.0

I would like the decimals to align in the center of the cell.

Can you do this with XSL:FO?

Thank You!


<fo:table space-before="6pt" space-after="6pt" border=" 0.5pt solid black"
text-align=" start" >
<fo:table-header font-weight=" bold" >
<fo:table-row>
<fo:table-cell padding=" 4pt" text-align=" center" border-bottom=" 0.25pt
solid black" border-right=" 0.25pt solid black" border-left= " 0.25pt solid
black " border-top=" 0.25pt solid black " >
<fo:block>Territory</fo:block>
</fo:table-cell>
<fo:table-cell padding=" 4pt" text-align=" center" border-bottom=" 0.25pt
solid black" border-right=" 0.25pt solid black" border-left= " 0.25pt solid
black " border-top=" 0.25pt solid black " >
<fo:block>Base Rate</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header> <fo:table-body text-align="center">
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>2</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   56.30</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>3</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   65.40</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>07</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>  104.50</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>9</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   61.00</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>14</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   60.80</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>23</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   68.00</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>24</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   59.20</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>25</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>  117.10</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>26</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>  102.50</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>27</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   73.00</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>28</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   72.70</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>29</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   86.80</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>30</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   75.20</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>31</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   80.90</fo:block></fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>999</fo:block></fo:table-cell>
<fo:table-cell padding=" 2pt" border-bottom=" 0.25pt solid black"
border-right=" 0.25pt solid black" border-left=" 0.25pt solid black" >
<fo:block>   72.50</fo:block></fo:table-cell>
</fo:table-row>
</fo:table-body> </fo:table>
Received on Thursday, 19 June 2003 09:20:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:11 GMT