[Zope] Lines with different colors

Yannis Lionis j_melt@yahoo.com
Thu, 6 Mar 2003 05:39:28 -0800 (PST)


--0-2113615433-1046957968=:50277
Content-Type: text/plain; charset=us-ascii


Here's a way:
Add a counter variable in your loop (if there isn't one already there). For every value you get from the database, increase the counter by one. While printing the value, if the counter is even, print blue, if it is odd, print yellow. You can check if the number is even or odd by dividing by 2 and checking if the remainder is 1 or 0. You can also use different colors than blue and yellow. ;-)
Hope this helps!
Yannis
 Sorin Marti <mas@semafor.ch> wrote:Hi all,

I am experimenting around with zope and I want to do following thing:

I call values from the database and give them out.
Now I want each second line in a different color.

How do I do that?

Thanks in advance

Sorin


_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more
--0-2113615433-1046957968=:50277
Content-Type: text/html; charset=us-ascii

<P>Here's a way:
<P>Add a counter variable in your loop (if there isn't one already there). For every value you get from the database, increase the counter by one. While printing the value, if the counter is even, print blue, if it is odd, print yellow. You can check if the number is even or odd by dividing by 2 and checking if the remainder is 1 or 0. You can also use different colors than blue and yellow. ;-)
<P>Hope this helps!
<P>Yannis
<P>&nbsp;<B><I>Sorin Marti &lt;mas@semafor.ch&gt;</I></B> wrote:
<BLOCKQUOTE style="BORDER-LEFT: #1010ff 2px solid; MARGIN-LEFT: 5px; PADDING-LEFT: 5px">Hi all,<BR><BR>I am experimenting around with zope and I want to do following thing:<BR><BR>I call values from the database and give them out.<BR>Now I want each second line in a different color.<BR><BR>How do I do that?<BR><BR>Thanks in advance<BR><BR>Sorin<BR><BR><BR>_______________________________________________<BR>Zope maillist - Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>** No cross posts or HTML encoding! **<BR>(Related lists - <BR>http://mail.zope.org/mailman/listinfo/zope-announce<BR>http://mail.zope.org/mailman/listinfo/zope-dev )</BLOCKQUOTE><p><br><hr size=1>Do you Yahoo!?<br>
<a href="http://rd.yahoo.com/finance/mailtagline/*http://taxes.yahoo.com/">Yahoo! Tax Center</a> - forms, calculators, tips, and more
--0-2113615433-1046957968=:50277--