Dictionary As Table In Django Template

前端 未结 2 741
独厮守ぢ
独厮守ぢ 2021-01-18 12:11

I have a dictionary:

field = 

{
   u\'Birthday:\': [datetime.date(2012, 4, 6), datetime.date(2012, 4, 27)],
   u\'Education\': [u\'A1\', u\'A2\'],
   u\'Job         


        
2条回答
  •  感动是毒
    2021-01-18 12:36

    Simeon's answer worked for me, but I had to do something a little different int the template to get the rows and data looking right because of the nested list:

            {% for row in field.rows %}
                
                    {% for value in row %}
                        {{value}}
                    {% endfor %}
                
            {% endfor %}
    

提交回复
热议问题