V
V
Villian_Os2021-03-11 08:17:21
Django
Villian_Os, 2021-03-11 08:17:21

How to display a python list by columns in a table in django template?

6049a33f6bf8d091446759.png

There is a table with three headings, under each heading it is required to put data from the python list for each division of time. The elements of the list are the names of the people in str. This list contains names for all three columns.
I know that you can divide the list by lines like this:

{% if forloop.counter|divisibleby:"2" %}<tr>{% endif %}
<td><td>
{% if not forloop.counter|divisibleby:"2" %}</tr>{% endif %}


And how can I do the same, but so that I have division by columns? That is, every 24 cells, I have a list on another column, the data of the list was displayed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-03-11
@Vindicar

Break the list in the code into several parts of 24 elements and insert each part separately?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question