hi, Does zope have an eazy way to alternate row colour in a table? Anyone have a slick way to do it? j. ...................... ..... Jason C. Leach ..
"Jason C. Leach" wrote:
hi,
Does zope have an eazy way to alternate row colour in a table? Anyone have a slick way to do it?
j.
...................... ..... Jason C. Leach ..
<dtml-in list> <dtml-if name="sequence-odd"> <tr bgcolor="#dfdfdf"> <dtml-else> <tr bgcolor="#ffffff"> </dtml-if> ... </tr> </dtml-in> hth, -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Something like this? <dtml-if "_['sequence-odd']"> bgcolor="gray"<dtml-else> bgcolor="white"</dtml-if> regards Max M Max M. W. Rasmussen, Denmark. New Media Director private: maxmcorp@worldonline.dk work: maxm@normik.dk ----------------------------------------------------- Shipping software is an unnatural act
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Jason C. Leach
Does zope have an eazy way to alternate row colour in a table? Anyone have a slick way to do it?
hi, Works great, can you explane the syntax in the dtml-if statment? What does the all the pucntuation do? Thanks, j. ...................... ..... Jason C. Leach .. On Tue, 12 Jun 2001, Max M wrote:
Something like this?
<dtml-if "_['sequence-odd']"> bgcolor="gray"<dtml-else> bgcolor="white"</dtml-if>
regards Max M
Max M. W. Rasmussen, Denmark. New Media Director private: maxmcorp@worldonline.dk work: maxm@normik.dk ----------------------------------------------------- Shipping software is an unnatural act
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Jason C. Leach
Does zope have an eazy way to alternate row colour in a table? Anyone have a slick way to do it?
hi,
Works great, can you explane the syntax in the dtml-if statment?
What does the all the pucntuation do?
Thanks, j.
Ok, let's break it into parts: ***** ['sequence-odd'] ***** Ok, you have a list of items. You want to have a gray background for alternating items when you list them out. An easy way to do this is to color the background of all EVEN numbered items or all ODD number items. Your choice. But that this bit of code is saying is --> in this particular sequence of items, if the sequence number is odd... When using it in this way, it will return 'True' if the index of the current item is odd. Therefore, this block of the dtml-if tag is executed. Now for the underscore: ***** _ ***** This is a special variable that allows you to explicitly access a variable in the DTML namespace. Therefore, _[x] will give you the object of which the name is given by x. Hope this helps, Tommy
participants (4)
-
Casey Duncan -
Jason C. Leach -
Max M -
Tommy Johnson