xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@swisslab.de
Subject AW: FOP - help in alternate color setting in table
Date Tue, 11 Apr 2006 09:56:44 GMT
You'll have to use a modulo function in xslt.
 
<xsl:template match="your_row_generating_element">
<fo:table-row>
<xsl:variable name=color>
<xsl:choose>
<xsl:when test="position() mod 2 = 0">
<xsl:text>blue</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>red</xsl:text>
</xsl:otherwise>
<fo:table-cell background-color="{$color}">
<fo:block>
your text
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template >
 
jan

-----Urspr√ľngliche Nachricht-----
Von: Debasish Jana [mailto:debasishj@anshinsoft.com]
Gesendet: Dienstag, 11. April 2006 11:42
An: fop-users@xmlgraphics.apache.org
Betreff: FOP - help in alternate color setting in table



Hi:

 

Is there any way to set alternate colors for rows and columns for a
fo:table? For example, I would like to set the first row as red, second as
blue, third as red and so on.

 

If there is no such attribute to do so, is there any workaround to
accomplish this?

 

Pls help.

 

Regards,

 

Debasish Jana

 


Mime
View raw message