This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Building tables with XSLT
- From: juggy at gmx dot net
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 10 Sep 2002 16:15:35 +0200
- Subject: Re: [xsl] Building tables with XSLT
- References: <001901c25895$60c26840$7b3ca8c0@suntzu>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Grr - of course the name should be "rowdisplay"
<xsl:template name="rowdisplay">
<xsl:param name="pos" />
<xsl:param name="width" />
<xsl:choose>
<xsl:when test="(position()+$width) < last()">
<xsl:for-each select="IMAGES/IMAGE[position() >= $pos and
position() <($pos+$width)">
<td>...put your image...</td>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="left"><xsl:value-of select="$width- (last() -
(position()))" /></xsl:variable>
<xsl:for-each select="IMAGES/IMAGE[position() >= $pos and
position() <($pos+$width)">
<td>...put your image...</td>
</xsl:for-each>
<td colspan="$left"></td>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Sorry about that - maybe I'm a little too tired already... ;-)
Juggy
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list