作者:南昌思锐 | 来源:互联网 | 2022-09-08 16:51
我们用Datatables经常会遇到这种情况,就是浏览器或者HTML里元素改变大小或分辨率后,标题就会出现不对齐现象。这种情况是因为Datatables框架中使用到serverSide : true,// 服务器查询数据属性,它会使Table标签中多一个属性,这就导致了变化大小时标题对不齐现象。

解决方法
#example{
width: 100% !important;
}
如果遇到设有横向滚动条时,就固定设置Table宽度
#example{
width: ***px !important;
}
收工,这样就完美解决了!!

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。