If you have a fixed number of items in each of the sublists you can do {{ i.0 }} # First element {{ i.1 }} # Second element
or you can iterate over it {% for sub_element in i %} {{ sub_element }} {% endfor %} On Thu, Feb 12, 2015 at 2:55 PM, dk <demi...@gmail.com> wrote: > i do have a list of list like this > [ [apple, banana, red] , [orange, grape, blue] , [watermelon, > tangerine, purple] ] > > > then i am passing it to the template like > return render(request, "show_table.html", {"lista": lista}) > inside my template html i have > > > <table border="1" style="width: 100%"> > {% for i in lista %} > <tr> > <td>{{ i }}</td> > {# <td> ----> Temp </td>#} > {# <td> {{ i }}</td>#} > </tr> > > {% endfor %} > </table> > > > > but how can i select i[0] or i[2] to put then into a diferent column? > might be a better trick on how to send it? > thanks. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/ec4f230b-73f0-495c-ad2d-db921ed227cc%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/ec4f230b-73f0-495c-ad2d-db921ed227cc%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei3Km-i%2BpHsQiUuC2pjdfE%3D_8XxzAn39He%2BNe6yQxvpqQg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.