I think you will find the following XSL snippet useful (I think it does exactly what you want):
<fo:table table-layout="fixed" width="100%">
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body>
<xsl:for-each select="itemDataVertical[position() mod 3 = 1]">
<fo:table-row>
<xsl:for-each select=".|following-sibling::itemDataVertical[position() < 3]">
<fo:table-cell padding="1pt">
<fo:block text-align="center">
<fo:table table-layout="fixed" width="100%" font-size="6pt">
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block text-align="end">
<xsl:apply-templates select="label"/>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-left="2mm">
<fo:block text-align="start">
<xsl:apply-templates select="value"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!--<xsl:apply-templates select="."/>-->
</fo:block>
</fo:table-cell>
</xsl:for-each>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
You will need to adjust it to fit your needs (like remove the nested table), but it should be pretty easy to implement.
-Lou
bharathi kongara <[EMAIL PROTECTED]> wrote on 12/09/2005 18:39:08:
> Hi guys,
>
> I need to put some content into columns dynamically with XSL-FO.
> I've a template called AnswerKeySection which can have one or more
> AnswerKeyQuestions. Now I need them arranged like 3
> AnswerKeyQuestions into 1 row. So I want something like
>
> Question1 Question2 Question3
> Question4 Question5 Question6
> Question7 Question8 Question9
>
> instead of
>
> Question1
> Question2
> Question3
> Question4
> Question5
> Question6
> Question7
> Question8
> Question9
>
> I'm wondering whether this is possible, I tried to use column-count
> property but didn't notice nay difference.
>
> I'm posting my code from XSL for a better understanding. Any help
> would be greatly appreciated.
>
> Thanks,
> Bharathi
>
> <xsl:template match="AnswerKeySection">
> <fo:block keep-together="always" white-space-colla pse = "false">
> <xsl:if test="not(position()=last())">
> <xsl:attribute name="break-after">page</xsl:attribute>
> </xsl:if>
> <xsl:apply-templates select="SectionName"/>
> <xsl:apply-templates select="SectionHeader"/>
> <xsl:apply-templates select="AnswerKeyQuestion"/>
> </fo:block>
> </xsl:template>
>
> <xsl:template match="AnswerKeyQuestion">
> <fo:table table-layout="fixed" width="100%" keep-together="always">
> <fo:table-column column-width="proportional-column-width(1)"/>
> <fo:table-body space-after.optimum="5pt" keep-together="always">
> <fo:table-row padding-bottom="0.5em">
> <fo:table-cell>
>
> <xsl:apply-templates select="QuestionInfo"/>
>
> </fo:table-cell>
> </fo:table-row>
> <fo:table-row keep-with-previous="always">
> <fo:table-cell>
>
> <xsl:apply-templates select="Notes"/>
>
> </fo:table-cell>
> </fo:table-row>
> <fo:table-row keep-with-previous="always">
> <fo:table-cell>
>
> <xsl:apply-templates select="Blank"/>
>
> </fo:table-cell>
> </fo:table-row>
> <fo:table-row keep-with-previous="always">
> <fo:table-cell>
>
> <xsl:apply-templates select="Order"/>
> ;
> </fo:table-cell>
> </fo:table-row>
> <fo:table-row keep-with-previous="always">
> <fo:table-cell>
>
> <xsl:apply-templates select="TrueFalse"/>
>
> </fo:table-cell>
> ; </fo:table-row>
> </fo:table-body>
> </fo:table>
> </xsl:template>
>
> Yahoo! Shopping
> Find Great Deals on Holiday Gifts at Yahoo! Shopping
- Arranging the content into columns bharathi kongara
- Re: Arranging the content into columns Louis . Masters