Does anybody know how to use XSLT to align floating point numbers in an
HTML Table?

(e.g.)

My ex.xml file looks like this:

<?xml-stylesheet href="ex.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
<mytable>
  <heading> My Heading </heading>
  <row> 1.234   </row>
  <row> 23.3432 </row>
  <row> 1.2     </row>
  <row> 111.221 </row>
</mytable>
---------------------
My ex.xsl file looks like this:

<?xml version='1.0'?> 
<xsl:stylesheet version="1.0" 
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

 <xsl:template match="/"> 
  <HTML><TITLE>Example</TITLE><BODY> 
  
  <TABLE border="3"> 
   <TR>
     <TD> <xsl:value-of select="mytable/heading"/> </TD>
   </TR>
   <xsl:for-each select="mytable/row"> 
   <TR>
     <TD align="center"><xsl:value-of select="."/></TD>
   </TR>
   </xsl:for-each> 
   </TABLE>

   </BODY></HTML> 
  </xsl:template> 
</xsl:stylesheet>
----------------------------------------------
My HTML table looks like this:

------------
| My Heading |
 ------------
|   1.234    |
 ------------
|  23.3432   |   
 ------------
|    1.2     |
 ------------
|   111.221  |
 ------------
If you look at the columns in my example, you will see that Floating
Point alignment does not take place correctly.

Has anyboy encountered this kind of problem or can help me fix it so
that my alignment will be correct such as:
--------------
| My Heading  |
 -------------
|    1.234    |
 -------------
|   23.3432   |   
 -------------
|    1.2      |
 -------------
|  111.221    |
 ------------
begin:vcard 
n:Alaniz;Carloz
x-mozilla-html:FALSE
org:ASIC New Products Development
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
x-mozilla-cpt:;1
fn:Carloz Alaniz
end:vcard

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to