Skip to content

Instantly share code, notes, and snippets.

@girisagar46
Created February 21, 2018 17:00
Show Gist options
  • Save girisagar46/402fdfcd2a4f3d75f3a71af54f6bbf9c to your computer and use it in GitHub Desktop.
Save girisagar46/402fdfcd2a4f3d75f3a71af54f6bbf9c to your computer and use it in GitHub Desktop.
<table border="1px solid">
<thead>
<tr>
<th>Dates</th>
<th>Latitude</th>
<th>Longitude</th>
</tr>
</thead>
<tbody>
<tr>
{% for each in output %}
<td>
<table>
{% for data in each %}
<tr>
<td>
{{ data }}
</td>
</tr>
{% endfor %}
</table>
</td>
{% endfor %}
</tr>
</tbody>
</table>
def test(request):
s = ''
s = ('dates,lat,long', ['date1', 'date2', 'date3'], [4, 5, 6], [7, 8, 9])
data = {
"output": s[1:len(s)] # Here we are slicing the output, since s[0] will mess up the HTML
}
return render(request, 'test.html', context=data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment