[Zope] ZPT: building to column table

Jochen Haeberle listen@midras.de
Wed, 11 Sep 2002 23:56:19 +0200


Hi list,

is there a way to build a table holding two columns of results???

My first try was like this:

1 	<table border="1">
2 	 <metal:block tal:repeat="result batch" >
3 		 <metal:block tal:define="resultObject result/getObject">
4 			 <metal:block tal:condition="repeat/result/odd">
5 			 <tr>
6 				 <td>
7 					left object
8 				 </td>
9 			 </metal:block>
10
11 			 <metal:block tal:condition="repeat/result/even">
12 				<td>
13 					right object
14 				</td>
15 			 </tr>
16 			 </metal:block>
17 		 </metal:block>
18 	 </metal:block>
19 	</table>


Bute TALES does not like the </tr> at line 15 because of illegal nesting.

Another try would be to save the odd object in a variable and build 
the total row in the even run. I could not get this to work, 
either... i would get errors or duplicate entries on both sides. I 
guess python works with pointers the same like Java does???


I guess I am stuck (again)... anyone has an idea for me please???


Jochen