Subject: RE: table column
From: David Neary <David@xxxxxxxxx>
Date: Mon, 19 May 2003 16:09:57 +0200
|
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"><tr></xsl:text>
</xsl:if>
<td>
<xsl:value-of select="."/>
</td>
<xsl:if test="position() % $cols = 0 or position() = last()">
<xsl:text disable-output-escaping="yes"></tr></xsl:text>
</xsl:if>
</xsl:template>
Hope this helps,
Dave.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- table column
- Fei Zheng - Fri, 16 May 2003 16:08:56 -0400 (EDT)
- <Possible follow-ups>
- Fei Zheng - Mon, 19 May 2003 09:36:29 -0400 (EDT)
- David Neary - Mon, 19 May 2003 10:12:00 -0400 (EDT) <=
- Fei Zheng - Mon, 19 May 2003 10:31:47 -0400 (EDT)
- David Neary - Mon, 19 May 2003 11:08:32 -0400 (EDT)
|
|