RE: [xsl] Background color in table

Subject: RE: [xsl] Background color in table
From: "Bryan Archer" <barcher@xxxxxx>
Date: Tue, 27 May 2003 13:51:18 +0100
Use the position() function.

<xsl:template match="/">
    <xsl:for-each select="root/pack/service" >
        <td bgcolor="#FFFFFF">  
          <xsl:if test="position() mod 2 = 1">
            <xsl:attribute name="bgcolor">#000000</xsl:attribute>
          <xsl:value-of select="name" />


-----Original Message-----
From: Andreas Byström [mailto:andreas.bystrom@xxxxxxxxxxxx]
Sent: 27 May 2003 13:33
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Background color in table

Hi all!

I'm about to make web page that should have a table of names in it. I would
like to have different background color on each other ro in the table,

I have trouble getting this to work with the XSL. This is an example on the
xml I have to work with

I want to list all services names. I managed to solve it when I only had one
<pack> tag, but now I can have several pack-tags. Does someone know how to
get a nice table from this data?


 XSL-List info and archive:
Visit our website at

This message is confidential.  You should not copy it
or disclose its contents to anyone.  You may use and apply the information
only for the intended purpose.  Internet communications are not secure and
therefore RM does not accept legal responsibility for the contents of this
message.  Any views or opinions presented are only those of the author and
not those of RM.  If this email has come to you in error please delete it
and any attachments.  Please note that RM may intercept incoming and
outgoing e-mail communications.

This email has been scanned for viruses by Trend ScanMail.

 XSL-List info and archive:

Current Thread