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. I have tried the above code but it doesn't seem to be working - anyone who remembers the correct code ? Regards, Gitte
<dtml-if sequence-index-odd> ought to work... :-) -- Geir Bækholt Web-Developer/Zopatista geirh@funcom.com http://www.funcom.com on or about, Monday, April 23, 2001, we have reason to believe that gitte@mmmanager.org wrote something along the lines of : gmo> Hello, gmo> One time I saw some code using something like: gmo> <dtml-if odd> gmo> <TR BACKGROUND="#FFFFFF"> gmo> <dtml-else> gmo> <TR BACKGROUND="#000000"> gmo> </dtml-if> gmo> used to color the lines differently in a table. gmo> I have tried the above code but it doesn't seem to be working - anyone who gmo> remembers the correct code ? gmo> Regards, gmo> Gitte gmo> _______________________________________________ gmo> Zope maillist - Zope@zope.org gmo> http://lists.zope.org/mailman/listinfo/zope gmo> ** No cross posts or HTML encoding! ** gmo> (Related lists - gmo> http://lists.zope.org/mailman/listinfo/zope-announce gmo> http://lists.zope.org/mailman/listinfo/zope-dev )
Okay I got it to work - sort of :-) Now I'm using it inside a CMF Portal. And I would like to use the built-in stylesheet so that every second line has another background color. But I am having some difficulties doing this. Do you need to set a class into the table tag to get it to work ? Because it doesn't work if I only set a class in the tr-tag. Regards, Gitte Citat Geir Bækholt <geirh@funcom.com>:
<dtml-if sequence-index-odd> ought to work...
:-)
-- Geir Bækholt Web-Developer/Zopatista geirh@funcom.com http://www.funcom.com
on or about, Monday, April 23, 2001, we have reason to believe that gitte@mmmanager.org wrote something along the lines of : gmo> Hello,
gmo> One time I saw some code using something like: gmo> <dtml-if odd> gmo> <TR BACKGROUND="#FFFFFF"> gmo> <dtml-else> gmo> <TR BACKGROUND="#000000"> gmo> </dtml-if> gmo> used to color the lines differently in a table.
gmo> I have tried the above code but it doesn't seem to be working - anyone who gmo> remembers the correct code ?
gmo> Regards, gmo> Gitte
gmo> _______________________________________________ gmo> Zope maillist - Zope@zope.org gmo> http://lists.zope.org/mailman/listinfo/zope gmo> ** No cross posts or HTML encoding! ** gmo> (Related lists - gmo> http://lists.zope.org/mailman/listinfo/zope-announce gmo> http://lists.zope.org/mailman/listinfo/zope-dev )
On Monday, April 23, 2001, at 11:21 AM, gitte@localhost wrote:
Okay I got it to work - sort of :-)
Just to muddy the waters, and because I also didn't know about sequence-item-odd, here's the way I created a list of links with different coloured backgrounds (using a folder full of RSSChannels).... <dtml-in "daily_feeds.objectValues()" sort='id"> <dtml-let x=sequence-item> <dtml-in expr="x.objectValues()" sort=bobobase_modification_time reverse=yes size=10> <tr > <td <dtml-if "not (_['sequence-index'])%2"> bgcolor="#C0C0C0" </dtml-if> > <a href="<dtml-var link>" target="_blank"
<dtml-var title></a> </td> </tr>
</dtml-in> </dtml-let> </dtml-in> ....cheers tom
<dtml-in list> <dtml-if sequence-odd> <TR BACKGROUND="#FFFFFF"> <dtml-else> <TR BACKGROUND="#000000"> </dtml-if> </dtml-in>
-----Message d'origine----- De : zope-admin@zope.org [mailto:zope-admin@zope.org]De la part de gitte@mmmanager.org Envoyé : lundi 23 avril 2001 11:28 À : zope@zope.org Objet : [Zope] Using odd numbers
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.
I have tried the above code but it doesn't seem to be working - anyone who remembers the correct code ?
Regards, Gitte
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
If you are using a standard <dtml-in > call you can do something like this.. <TABLE> <dtml-in somelist> <dtml-if sequence-even> <TR bgcolor="#eeeeee"> <dtml-else> rest of table stuff... </dtml-in> </TABLE> Tom Cameron => -----Original Message----- => From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of => gitte@mmmanager.org => Sent: Monday, 23 April 2001 7:28 PM => To: zope@zope.org => Subject: [Zope] Using odd numbers => => => 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. => => I have tried the above code but it doesn't seem to be working - => anyone who => remembers the correct code ? => => Regards, => Gitte => => _______________________________________________ => Zope maillist - Zope@zope.org => http://lists.zope.org/mailman/listinfo/zope => ** No cross posts or HTML encoding! ** => (Related lists - => http://lists.zope.org/mailman/listinfo/zope-announce => http://lists.zope.org/mailman/listinfo/zope-dev ) =>
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
participants (8)
-
Geir B�kholt -
gitte@localhost -
gitte@mmmanager.org -
Ivan Cornell -
Morten W. Petersen -
Peter Bengtsson -
Tom Cameron -
tom smith