123456789101112131415161718192021222324252627282930313233343536373839 |
- {% extends 'base.html' %}
- {% block title %}遍历数据{% endblock %}
- {% block content %}
- <h2>我喜欢的水果</h2>
- <ul>
- {% for fruit in fruits %}
- <li>{{ fruit }}</li>
- {% endfor %}
- </ul>
- <h2>个人信息表</h2>
- <table class='mdui-table'>
- <thead>
- <tr>
- <th>id</th>
- <th>name</th>
- <th>sex</th>
- <th>height</th>
- <th>weight</th>
- </tr>
- </thead>
- <tbody>
- {% for profile in profiles %}
- <tr>
- <td>{{ profile['id'] }}</td>
- <td>{{ profile['name'] }}</td>
- <td>{{ profile['sex'] }}</td>
- <td>{{ profile['height'] }}</td>
- <td>{{ profile['weight'] }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% endblock %}
|