tables in jinja template

Solutions on MaxInterview for tables in jinja template by the best coders in the world

showing results for - "tables in jinja template"
Monica
27 Sep 2018
1<table>
2{% for item in items %}
3<TR>
4   <TD class="c1"><IMG src="favicon.ico"></TD>
5   <TD class="c2">{{item.date}}</TD>
6   <TD class="c3">{{item.id}}</TD>
7   <TD class="c4"><SPAN>{{item.position}}</SPAN></TD>
8   <TD class="c5"><SPAN>{{item.status}}</SPAN></TD>
9</TR>
10{% endfor %}
11</table>
12
Vincent
30 Feb 2018
1items = []
2for i in range(1, 11):
3    i = str(i)
4
5    # dict == {}
6    # you just don't have to quote the keys
7    an_item = dict(date="2012-02-" + i, id=i, position="here", status="waiting")
8    items.append(an_item)
9
10# ... your code here ...
11
12template.render(items=items)
13