Thanks a lot for your help everyone...those are great resources.

On Oct 12, 5:50 am, Tim Chase <[EMAIL PROTECTED]> wrote:
> > I have an array and I want to use Django templating to display each
> > item in a table, grouped by 3 per row.
> > For example, if i have
> >   arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
> > Then I'd want it to show up as
> > <table>
> >   <tr><td>a</td><td>b</td><td>c</td></tr>
> >   <tr><td>d</td><td>e</td><td>f</td></tr>
> >   <tr><td>g</td><td>h</td><td>i</td></tr>
> >   <tr><td>j</td><td></td><td></td></tr>
> > </table>
>
> > In general, the array could be any length, and it's possible I'd want
> > to do 4 or 5 per row, not necessarily 3.
>
> > What's the easiest way to do this?  Thanks a bunch.
>
> I've solved this a couple times before on this list, so you might
> find either of these two threads (and the python code for
> creating a corresponding columnize template filter) useful:
>
> http://groups.google.com/group/django-users/browse_frm/thread/b5f531e...
>
> http://groups.google.com/group/django-users/browse_frm/thread/a9ca56a...
>
> It also allows you to tweak the values returned for the "empty"
> cells when it squares it off (your content of your last two <td>
> nodes), so you can pad with the empty string, or you can use
> something like "&nbsp;" as your padding.
>
> Hope this helps,
>
> -tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to