I have been trying to populate these output in flask template table view.But when it renders it displays the last list value in table (overwriting first list ). Can anyone please help me on how to create a new column when second list comes in to the picture?
Python code:
for i in mac:
#sqlite query
usage_list = cur.fetchall()
output of usage_list:
[5.0, 5.0, 5.0, 5.0, 5.0]
[10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0]
HTML code
{% for item in usagelist %}
<tr>
<td> {{item}} </td>
</tr>
{% endfor %}
Desired output: ex:
col 1 col 2
10.0 0.0
10.0 5.0
10.0 5.0
10.0 5.0
10.0 0.0
10.0 5.0
usage_list. Also, under "output of usage_list", you show two lists. Do you mean there is another variable, saylist2, which is another list and which should be used to populate the second column?