[Zope] html templates

Kevin Carlson khcarlso@bellsouth.net
Thu, 13 Feb 2003 17:28:06 -0500


Using dtml:

<table>
<dtml-in ZSQL>
  <dtml-if expr="_['sequence-index'] % 2 == 0">
     <dtml-if expr="_['sequence-index'] > 0">
        </tr>
     </dtml-if>
     <tr width="33%">
  </dtml-if>
  <td><dtml-var yourdata></td>
</dtml-in>
</table>

You could also use <dtml-if sequence-even> or <dtml-if  sequence-odd>.  
Using the code above gives you the ability to have any number of columns 
by changing the operator of the modulus function.  In other words, to 
get three columns replace the appropriate line with:

  <dtml-if expr="_['sequence-index'] % 3 == 0">

Hope that helps,

Kevin

Lester Cram wrote:

>I,m trying to layout results returned from a mysql query.
>I use a Zsql method and z search interface
>The results come from a single table and come back as a string or tabular list.
>What is the best way to change the layout from
>1
>2
>3
>4
>or 1234
>to 
>12
>34
>thanks
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://mail.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists - 
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
>  
>