【发布时间】:2018-03-15 19:37:25
【问题描述】:
我正在使用 bootstrap-table 创建我的表,它运行良好,但它看起来有点奇怪,因为高度似乎只是固定的,不管它有多少数据。因此,如果我只有 6 条记录,那么下面就只有这个尴尬的空白空间。这是我的html:
<table class="table" data-toggle="table" data-page-size="10" data-pagination="true" data-search="true">
<thead>
<tr>
<th data-sortable="true">Username</th>
<th data-sortable="true">Full Name</th>
<th data-sortable="true">Points</th>
{% for subject in subjects %}
<th data-sortable="true">{{ subject }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>
<a href="{% url 'profile' username=user.username %}">{{ user.username }}</a>
</td>
<td>{{ user.first_name }} {{ user.last_name }}</td>
{% for item in user.profile.points %}
<td>{{ item.1 }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
关于如何解决这个问题的任何想法?
【问题讨论】:
标签: bootstrap-4 bootstrap-table