xsl-list
[Top] [All Lists]

Re: two column table with alternating row colors using xsl xml and css

2003-08-08 03:19:40
On 08-08-2003 11:55, "nicholse(_at_)sdf(_dot_)lonestar(_dot_)org" 
<nicholse(_at_)sdf(_dot_)lonestar(_dot_)org>
wrote:
<xsl:if test="position() &lt; ceiling(count(../fmp:ROW) div 2)"> this
gives an error why?

The position() function expects his/her data within the brackets, not after.

<TD class="r{position() + 1 mod 2}">why cant I use this to alternate the
row/column data colour?

When you want to insert data into a parameter for an HTML tag, try this:


<td>
<xsl:attribute name="class">
<xsl:value-of select="r{position() + 1 mod 2}" />
</xsl:attribute>

-your info in the cell here-

</td>



Same way for <img>, <a>, and so on.


Patrick


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