微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

bootstrap table显示的问题 :关于table的换行和滚动

  <table class="table table-bordered table-sm">
            <thead>
            <tr>
                <th>操作</th>
            </tr>
            </thead>
            <tbody id="tbody">
            {% for student in object_list %}
                <tr>
                     <td>
                        <a class="btn btn-sm btn-success" href="{% url 'd3:StudentUpdateChuhe' student.id %}">初核</a>
                    </td>

                </tr>
            {% empty %}
                <tr>
                    <td colspan="99">没有检索到数据</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>

因为是responsive模式,table里面的内容自动折行,不太好看

 

 

 

修改

  关键1: table加上 text-Nowrap

<table class="table table-bordered table-striped table-sm text-Nowrap">
加上后,随不这行了,但是屏幕布局变了,右侧拉伸很多。

关键2:把整个table放入 如下的 div中
<div style="overflow:scroll;">
   <table class="table table-bordered table-striped table-sm text-Nowrap">
省略
</table> </div>

 


                
                                 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐