xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor Smirnov" <vic...@uwc.ru>
Subject Colored table :)
Date Tue, 28 Mar 2000 06:25:40 GMT
Hello all!

May be this can be usefull for someone:)

With this xsl instruction one can color every even row in a table with light
grey:

<xsl:template match="blk_item[position() div 2 != floor(position() div 2)]">
 <tr bgcolor="#EFEFEF">
  <td>
   <xsl:apply-templates select="blk"/>
  </td>
  <td align="right">
   <strong>
    <xsl:apply-templates select="cnt"/>
   </strong>
  </td>
 </tr>
</xsl:template>

<xsl:template match="blk_item[position() div 2 = floor(position() div 2)]">
 <tr>
  <td>
   <xsl:apply-templates select="blk"/>
  </td>
  <td align="right">
   <strong>
    <xsl:apply-templates select="cnt"/>
   </strong>
  </td>
 </tr>
</xsl:template>

It asumes the following xml

<blk_item>
    <blk>abc</blk>
    <cnt>1</cnt>
</blk_item>
<blk_item>
    <blk>def</blk>
    <cnt>2</cnt>
</blk_item>
...

- Victor



Mime
View raw message