[ZPT] repeat and odd/even question

random at dxtx.net random at dxtx.net
Sun Apr 4 20:40:46 EDT 2004


Hi ZPT list,

I have a brief question.. I have a tal:repeat running from a db query, and i want to stagger the results in two columns, so
it will look like this:

data1 .. data2
data3 .. data4
data5 .. data6
data7

I am using the odd/even checking and I ALMOST have this working.  My problem is that since the repeat is on a <span>,  and i have to do a lot of html <td> and <tr> formatting for each column, i can't properly close each row.  Here's a psuedocode version of my setup.

<span repeat>
<tr>
if even, do <span><td>left column</td></span>
if odd, do <span><td>right column</td></span>
</tr>
</span>

You can see the problem is that I only want to close the tablerow after it does the right column.  But I can't put the </tr> there inside the odd column's condition, because it breaks because of what i assume are nesting problems.  (a </tr> inside the right column <span> tags, where the opening <tr> is way above it and outside the <span> tags)

for some reason i can't think of a logical solution to this using ZPT...... :(

any help/tips would be MUCH appreciated,
thank you
tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zpt/attachments/20040404/6d3893ca/attachment.html


More information about the ZPT mailing list