您的位置:首页 > Web前端 > BootStrap

bootstrap-table设置height后表头与内容无法对齐的问题

2017-09-12 09:32 791 查看
bootstrap-table项目官网:https://github.com/wenzhixin/bootstrap-table

bootstrap-table各版本下载:https://github.com/wenzhixin/bootstrap-table/releases

bootstrap-table API文档:http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/

表头对不齐效果如下:



解决方法如下:

1、升级到最高版本,比如现在是1.11.1的(方法最快,什么都不用改)。

2、去掉height的设置。

3、如果是1.9.1版本的,可以通过如下设置:

$('#tableId').bootstrapTable(); // init via javascript

$(window).resize(function () {
$('#tableId').bootstrapTable('resetView');
});


但实质效果不大,可能还是无法达到效果。尤其是在1.9.0版本上用这个方法是无效的。

4、通过修改源码的形式,这个方式不可取,不然会出现各种问题,比如表头不固定等。

参考:

http://blog.csdn.net/xinshijimanon/article/details/53907404

http://blog.csdn.net/u013630349/article/details/53113191

http://tieba.baidu.com/p/4865094716

http://www.cnblogs.com/weichangyu/p/6269265.html

http://blog.csdn.net/u013451157/article/details/68983349

https://segmentfault.com/q/1010000009406117

http://www.cnblogs.com/hz-cww/p/6294909.html

https://segmentfault.com/q/1010000009406117/a-1020000009413009

http://blog.csdn.net/zhangzhida163/article/details/68928001
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: