[Zope] Using odd numbers

Ivan Cornell ivan.cornell@framestore.co.uk
Mon, 23 Apr 2001 10:41:46 +0100


gitte@mmmanager.org wrote:

> Hello,
>
> One time I saw some code using something like:
> <dtml-if odd>
>  <TR BACKGROUND="#FFFFFF">
> <dtml-else>
>  <TR BACKGROUND="#000000">
> </dtml-if>
> used to color the lines differently in a table.

If you are inside a <dtml-in>  loop, you can use the sequence-odd
& sequence-even variables:

<dtml-in mySequence>
  <dtml-if sequence-odd>
   <TR BACKGROUND="#FFFFFF">
  <dtml-else>
   <TR BACKGROUND="#000000">
  </dtml-if>
</dtml-in>

Ivan