Hi,

One approach is like this:

<tr py:for="i in range(0, len(pics), 2)">
<td>${pics.get(i)}</td>
<td>${pics.get(i+1)}</td>
</tr>

There is probably a neater way of doing this using some of Python's funky
iteration tools. Note that above you must use pics.get, not pics[] in case
there is an odd number of pics.

Enjoy,

Paul


On 12/6/06, David Xiao <[EMAIL PROTECTED]> wrote:
>
>
> I am not quite understand how to generate KID template in that way.
> For example, pics = Pictures.select(orderBy='shortname') returns 5
> results, and I want the HTML code look like, 2 elements per row:
> <table>
> <tr>
>   <td>result 1</td>
>   <td>result 2</td>
> </tr>
> <tr>
>   <td>result 3</td>
>   <td>result 4</td>
> </tr>
> <tr>
>   <td>result 5</td>
>   <td></td>
> </tr>
> </table>
>
> How should I write .kid template code?
>
>
> >
>


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to