0

I successfully loaded the csv file as a list of lists, passing that list over the the sheet template. Like so:

@app.route("/sheet", methods=["GET"])
def get_sheet():
    with open("survey.csv", "r") as file:
        reader = csv.reader(file)
        data = list(list(item) for item in csv.reader(file,delimiter=','))
        return render_template("sheet.html",data=data)

In my sheet template, I attempt to create a new row of table for each list, with a new cell for each item of list:

<tb>
    {% for row in data %}
        <tr>
            {% for item in row %}
                <td>{{item}}</td>
            {% endfor %}
        </tr>
        {% endfor %}
</tb>

But in my browser, all items are simply listed on one line. Where am I going wrong. Help would be much appreciated.

2
  • Turns out that the problem was just that i used <tb> tags instead of the correct <table>. s
    – lashem
    Dec 3 '19 at 11:13
  • Great you were able to figure it out by yourself. But if you found an answer, make it an answer, not a comment to your question.
    – Blauelf
    Dec 4 '19 at 6:03
0

Turns out that the problem was just that i used tags instead of the correct

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .