0

I want to iterate over a list in Jinja and display the table (borders) in HTML.

My list looks like this: mylist1 = [[e1, e2, e3, e4], [e5, e6, e7, e8], [e9, e10,..]]

The first element of the list [e1,e2,e3,e4] is headers.

I found the link to a similar answer: Similar answer

But its still not giving me the results in a table format.

<table>    
 {% for result in mylist1 %}
 <tr>
  {% for elem in result %}
    <td>{{elem}}</td>
    {% endfor %} 
  </tr>
{% endfor %}

</table>

I am getting the results in one line as - [e1,e2,e3,e4,e5,e6,e7,..].

What I want is to create a table with borders from this list. Could anyone please tell what I'm doing wrong?

sao
  • 1,835
  • 6
  • 21
  • 40
Gaurav
  • 1
  • 5

0 Answers0