|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Global extension function
Hi TP,
> What I want to do is change the background color of the table every
> 3 lines. This is the only way that I have found to do this. If you
> or someone have some ideas on how to solve this using standard xsl,
> I would appreciate it.
Use position() mod 3 = 1 to identify every third line, so something
along the lines of:
<xsl:for-each select="line">
<xsl:variable name="background">
<xsl:choose>
<xsl:when test="position() mod 3 = 1">white</xsl:when>
<xsl:otherwise>#d4e3ff</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div style="background-color: {$background};
color: black; margin-top: 0px; margin-left: 2px;
margin-right: 2px; margine-bottom: -19px">
...
</div>
</xsl:for-each>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








