[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: table column

Subject: RE: table column
From: David Neary <David@xxxxxxxxx>
Date: Mon, 19 May 2003 16:09:57 +0200
RE:  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:if>
  <td>
    <xsl:value-of select="."/>
  </td>
  <xsl:if test="position() % $cols = 0 or position() = last()">
    <xsl:text disable-output-escaping="yes">&lt;/tr&gt;</xsl:text>
  </xsl:if>
</xsl:template>

Hope this helps,
Dave.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.