Hi Guys,

 

I’m developing a dynamic ZPT that builds a table dynamically from an external database. I’d like to create a table row with at most two columns.  The condition is that if there is an odd number of data, the last table row will only contain one <td>.  If there is an even number of data, then the last table row will contain two <td>’s.  Sounds pretty simple right?  Just create a condition on the closing </tr> tag….well as I have found out, it’s not so simple in TAL.

 

For example:

 

4 items of data will create two table rows

 

<tr>

   <td></td>

   <td></td>

</tr>

<tr>

   <td></td>

   <td></td>

</tr>

 

5 items of data will create 3 table rows

 

<tr>

   <td></td>

   <td></td>

</tr>

<tr>

   <td></td>

   <td></td>

</tr>

<tr>

   <td></td>

</tr>

 

 

In TAL, you cannot create a condition on a closing tag because Zope will treat it as invalid HTML since the opening <tr> tag will not have a closing </tr> tag.  This really makes simple tasks such as mine very complex now.

 

Ideally, I would like TAL to function somewhat like so without Zope complaining:

 

<tal:tr condition="logic goes here"></tr></tal:tr>

 

 

Any suggestions?

 

Thanks,

 

Mike

 

 

 

Mike Takahashi
Web Developer • 
[EMAIL PROTECTED]

UCLA Office of Instructional Development
mtakahashi (at) oid.ucla.edu
310.794.9371

 

_______________________________________________
ZPT mailing list
ZPT@zope.org
http://mail.zope.org/mailman/listinfo/zpt

Reply via email to