title: Django populate html table with list values
body: <p>I am trying to populate my html table with data from parsed txt file using Django.
  For now my parse.py program serves txt file in list, example:</p>
  
  <pre><code>[['1523501752', 'mac', '192.168.1.180', 'Device1', 'mac'], 
  ['1523514991', 'mac', '192.168.1.113', 'device2', 'mac']]
  </code></pre>
  
  <p>Every inside list represents one line txt file (information about device). I am saving this list in variable and using it as a context. Problem is that I need specific arguments from lists. I mean in html table i will have three columns and as much rows as there will be lists in context. Those three columns will be ip address, device name and mac address.</p>
  
  <p>For now my code looks like this:</p>
  
  <pre><code>    &lt;tbody&gt;
          {% for line in lines  %}
          &lt;tr&gt;
            {% for value in line%}
              &lt;td&gt;{{ value.1}}&lt;/td&gt;
              &lt;td&gt;{{ value.2 }}&lt;/td&gt;
              &lt;td&gt;{{ value.3 }}&lt;/td&gt;
          &lt;/tr&gt;
            {% empty %}
            &lt;tr&gt;
                &lt;td colspan="8" class="text-center bg-warning"&gt; Device not found &lt;/td&gt;
            &lt;/tr&gt;
            {% endfor %}
          {% endfor %}
      &lt;/tbody&gt;
  </code></pre>
  
  <p>But results are really not as expected... DTL takes just 1 symbol at a time..
  How could I solve this problem?</p>
  
  <p>Tried to search information in:</p>
  
  <p><a href="https://stackoverflow.com/questions/31125146/django-html-table-with-iterative-lists-values">Django : HTML Table with iterative lists values</a> and
  <a href="https://stackoverflow.com/questions/29336520/how-to-populate-html-table-with-info-from-list-in-django">How to populate html table with info from list in django</a></p>
  
  <p>Unfortunately there was no right answer.</p>