RE: [xsl] table column

Subject: RE: [xsl] table column
From: "Fei Zheng" <Fei.Zheng@xxxxxxx>
Date: Mon, 19 May 2003 10:31:09 -0400
Great! This works! Thanks Dave!

-----Original Message-----
From: David Neary [mailto:David@xxxxxxxxx]
Sent: Monday, May 19, 2003 10:10 AM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE: [xsl] table column

I've done this...

> I put the <td> and the contents of the element inside the 
> conditional statement, the result was a one column table like this.
> item1
> item2
> item3
> item4
> item5
> item6
> The layout I wanted was a two column table like
> item1 	item2
> item3		item4
> item5		item6

<xsl:template match="item">
  <xsl:param name="cols" select="2"/>

  <xsl:if test="position() % $cols = 1">
    <xsl:text disable-output-escaping="yes">&lt;tr&gt;</xsl:text>
    <xsl:value-of select="."/>
  <xsl:if test="position() % $cols = 0 or position() = last()">
    <xsl:text disable-output-escaping="yes">&lt;/tr&gt;</xsl:text>

Hope this helps,

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread