Discussion:
XSL-FO: Table with dynamic number of column
(too old to reply)
Alvin Taliman
21 years ago
Permalink
Hi,

How can I create table with dynamic number of columns (can be 5, 10, 100)? I
think the best way is to divide the column into several table, for example 5
columns per table.
Can anyone help me with this? I'm using XSL-FO.

Example:
Title col1 col2 col3 col4 col5

Title col6 col7 col8 col9 col10

Thank you.
Alvin
Oleg Tkachenko [MVP]
21 years ago
Permalink
Post by Alvin Taliman
How can I create table with dynamic number of columns (can be 5, 10, 100)? I
think the best way is to divide the column into several table, for example 5
columns per table.
Can anyone help me with this? I'm using XSL-FO.
XSL-FO has nothing to do with it. Instead do it in XSLT level.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
*Davide*
21 years ago
Permalink
Post by Alvin Taliman
How can I create table with dynamic number of columns (can be 5, 10, 100)? I
think the best way is to divide the column into several table, for example 5
columns per table.
Can anyone help me with this? I'm using XSL-FO.
Hi Oleg,
I have the same problem, but I need to solve this on xsl-fo. My tables have
different number of culumns.
This is my code:

<xsl:template match="TABLE">
<fo:table table-layout="fixed" font-size="11px" font-family="Times"
border="1pt solid black">
<!--
<xsl:for-each select="TH/@align">
<fo:table-column column-width="3cm"/>
</xsl:for-each>-->
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-column column-width="3cm"/>
<fo:table-body>
<xsl:apply-templates select="TR"/>
</fo:table-body>
</fo:table>
<fo:block space-after="0.5cm"/>
</xsl:template>

How I change the <fo:table-column column-width="3cm"/> if xsl:for-each
doensn't run?

Hi and thanks
Oleg Tkachenko [MVP]
21 years ago
Permalink
Post by *Davide*
How I change the <fo:table-column column-width="3cm"/> if xsl:for-each
doensn't run?
Change to what?
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
*Davide*
21 years ago
Permalink
Post by Oleg Tkachenko [MVP]
Post by *Davide*
How I change the <fo:table-column column-width="3cm"/> if xsl:for-each
doensn't run?
Change to what?
Hi Oleg,

I need to implement a dynamic table, I mean what I need to create a dynamic
table on xsl-fo, without specify <fo-co*>

Thanks
Oleg Tkachenko [MVP]
21 years ago
Permalink
Post by *Davide*
I need to implement a dynamic table, I mean what I need to create a dynamic
table on xsl-fo, without specify <fo-co*>
fo:table-column isn't required in XSL-FO. Go ahead, just make sure your
XSL-FO processor supports table-layout="auto". Beware, FOP doesn't.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Alvin Taliman
21 years ago
Permalink
Thanks for your reply.
Can you give me example how to do it in XSLT level?
Thank you.
Post by Oleg Tkachenko [MVP]
Post by Alvin Taliman
How can I create table with dynamic number of columns (can be 5, 10, 100)? I
think the best way is to divide the column into several table, for example 5
columns per table.
Can anyone help me with this? I'm using XSL-FO.
XSL-FO has nothing to do with it. Instead do it in XSLT level.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Oleg Tkachenko [MVP]
21 years ago
Permalink
Post by Alvin Taliman
Can you give me example how to do it in XSLT level?
Basically it's the same grouping problem as with making calendar layout.
See excellent Jeni Tennison's explanation:
http://www.biglist.com/lists/xsl-list/archives/200101/msg00202.html
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Loading...