title: django template variable number of fields build of table from queryset
body: <p>I'm trying to build a table in a template based on a variable number of fields.
  The code I'm using is:</p>
  
  <pre><code>&lt;table id="custom_report_table" class="display" width="100%"&gt;
            &lt;thead&gt;
              {% for field in fields %}
                  &lt;th&gt;{{ field }}&lt;/th&gt;
              {% endfor %}
            &lt;/thead&gt;
            &lt;tdody&gt;
              {% for CI in CIs %}
                &lt;tr&gt;
                    &lt;td&gt;{{ CI }}&lt;/td&gt;
                &lt;/tr&gt;
              {% endfor %}
             &lt;/tdody&gt;
          &lt;/table&gt;
  </code></pre>
  
  <p>fields is a list with all the fields and CIs is a queryset with the data that needs to go into the table.
  The problem is that I usually know the name of the fields so I can call each on individually when creating the cells in the usual way:</p>
  
  <pre><code>{{CI.field1}}
  {{CI.field2}}
  ....
  </code></pre>
  
  <p>But now I can't hard code the fields' names as they are variable and come from the list.</p>
  
  <p>Is there a way to do this?</p>
  
  <p>Thanks,
  Isaac</p>