Do not know the reasons why the row in the HTML table will repeat in number of times per the length of rows. Please see my codes as follows:
application.py rows = db.execute("SELECT * FROM history WHERE hid = :id", id=sid) return render_template("history.html", rows=rows)
history.html {% for rowindex in range(rowlen) %} {{ rows[rowindex]['hsymbol'] }} {{ rows[rowindex]['hshare'] }} ${{ rows[rowindex]['hprice'] }} {{ rows[rowindex]['transacted'] }} {% endfor %}