Is there any way to print the python dictionary in to a table in HTML. I have a python dictionary and am sending to HTML by using
return render_template(\'i
I've had better luck putting the dictionary into a list of lists, then have the html loop through the list and print the table. The python would be:
Table = []
for key, value in results_dict.iteritems(): # or .items() in Python 3
temp = []
temp.extend([key,value]) #Note that this will change depending on the structure of your dictionary
Table.append(temp)
Then in your html you loop through the table.
{% for t in table %}
{% for i in t %}
{{ i }}
{% endfor %}
{% endfor %}