Thanks Chuck ... I juste have to upgrade to 0.20.3 to implement this, but it works nicely. Flo ----- Original Message ----- From: "Chuck Paussa" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 13, 2002 7:12 PM Subject: Re: computing table-column width
> Florence Deforge wrote: > > > Hello > > I need to create a style sheet which displays tables. > > In the xml instance tables are defined as follow : > > <table> > > <line> > > <cell>...</cell> > > <cell>...</cell> > > ... > > </line> > > </table> > > Tables can have any number of columns and I wonder if it is possible > > to create a single template that would first compute the number of > > column (assuming all lines have the same number of columns) then > > compute the column width according to this number. > > > > Has anyone done something similar ? > > > Here's some totally untested code but, if you debug it, it should work. > > <xsl:template match="table"> > <fo:table width="190mm"> > <xsl:for-each select="./line/cell"> > <fo:table-column column-width="proportional-column-width(1)"/> > </xsl:for-each> > <fo:table-body> > <xsl:for-each select="./line"> > <fo:table-row> > <xsl:for-each select="./cell"> > <fo:table-cell><xsl:value-of > select="."/></fo:table-cell> > </xsl:for-each> > </fo:table-row> > </xsl:for-each> > </fo:table-body> > </fo:table> > </xsl:template> > > Chuck > >