[Zope] Building tables from a db in dtml...
Jim Sanford
jsanford@atinucleus.com
Sun, 27 Feb 2000 02:56:32 -0600
Try this (untested):
<dtml-in query>
<dtml-if "_['sequence-start']">
<table><tr>
</dtml-if>
<dtml-if "_.int(_['sequence-index'])!=0 and (_.int(_['sequence-index'])+1)%4==1">
</tr><tr>
</dtml-if>
<td>Row1</td>
....
</dtml-in>
</tr></table>
__________________________________________________________________
Jim Sanford
. Database/Web Engineer
/ \ / Accelerated Technology, Inc.
/ / 720 Oak Circle Drive East
/ / \ Mobile, AL 36609
/ / \ Voice: 334-661-5770 fax: 334-661-5788
/ \ E-Mail: jsanford@atinucleus.com
Web: http://www.atinucleus.com
Source Code, No Royalties, Any CPU...It just make sense !
__________________________________________________________________
----- Original Message -----
From: <jiva@devware.com>
To: <zope@zope.org>
Sent: Saturday, February 26, 2000 10:44 PM
Subject: [Zope] Building tables from a db in dtml...
So, I want to generate a table using DTML and data from a database. I
want each row returned from the database to go into it's own html cell, and
I want to have say, 4 html columns across the page before starting a
new row. So like:
<table>
<tr>
<td> Row 1 from DB </td>
<td> row 2 from db </td>
<td> row 3 from db </td>
<td> row 4 from db </td>
</tr> <tr>
<td> row 5 from db </td>
...
How can I do this? Is there some kind of dtml-if I can wrap around
the </tr><tr> to only make it show every 4th row?
--
Miksch's Law:
If a string has one end, then it has another end.
_______________________________________________
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 )