bootstrap 设置表格固定宽度 内容换行

在项目中开发的时候用的bootstrap,但是有些表格的内容

会显示的很长

那么我第一时间想到的就是 修改td或者th的width,但是我设置了 之后不起作用

于是百度找到了解决方法:

学习源头:

https://blog.csdn.net/u011233568/article/details/79199007

https://blog.csdn.net/qq_30616169/article/details/55212284?locationNum=7&fps=1

于是代码就是

<style>
        #tb {table-layout:fixed;}
    </style>
<table class="table table-bordered table-hover" id="tb" style="word-break:break-all; word-wrap:break-all;" >
</table>
<th class="text-left" style="width: 186px;">xxx</th>

猜你喜欢

转载自www.cnblogs.com/djwhome/p/9429413.html