Building a Bootstrap table with dynamic elements in Flask
You're missing a few <tr>
and <td>
tags:
<table class="table"> <thead> <tr> <th>name</th> <th>age</th> <th>option</th> <tr> </thead> <tbody> {% for person in people %} <tr> <td>{{ person.name }}</td> <td>{{ person.age }}</td> <td>{{ person.option }}</td> </tr> {% endfor %} </tbody></table>
You're aiming for a table-row (<tr>
) per user, and some table-data (<td>
) for each of their attributes. You've also got a {% endblock %}
where you should have an {% endfor %}
.