[ZPT] Generating tables in Page Templates

Jamie Heilman jamie at audible.transient.net
Wed May 7 23:01:04 EDT 2003


Evan Simpson wrote:
> The ZopeLabs Cookbook is great for this kind of thing.  See for example:
> 
> http://www.zopelabs.com/cookbook/998066576

Or without ZTUtils:

<table tal:define="items python:range(9);width python:2">
<tr tal:repeat="j python:range(0, len(items), width)">
 <td tal:repeat="i python:items[j:j+width]" tal:content="i"></td>
</tr>
</table>

Presumebly "items" will be something slightly more interesting, but
you can change "width" easily enough.

-- 
Jamie Heilman                   http://audible.transient.net/~jamie/
"...thats the metaphorical equivalent of flopping your wedding tackle 
 into a lion's mouth and flicking his lovespuds with a wet towel, pure 
 insanity..."						-Rimmer



More information about the ZPT mailing list