I have a list which contains different information. I want to print them out so I did this:
<tr>
{% for item in aList %}
<td class="dateIndex">
<div>Date: {{item[0]}}</div>
<div>Price: {{item[1]}}</div>
<div>Status: {{item[2]}}</div>
</td>
{% endfor %}
</tr>
The problem is that all items
go to a single line and the output looks like this:
Date: 1 200 available
Price:
Status:
When I'd like it to be:
Date: 1
Price: 200
Status: available
Any tips are appreciated.
EDIT:
aList contains items from a CSV file which looks like this
@app.route('/rent')
def rent():
aList = readFile('static\\dates.csv')
return render_template('rent.html', aList = aList)
def readFile(aFile):
with open(aFile, 'r') as inFile:
reader = csv.reader(inFile)
file = [row for row in reader]
return file