jqGrid表头与数据不对齐的问题

大城市里の小女人 提交于 2020-04-07 11:29:37

原文:https://bbs.csdn.net/topics/392100457?depth_1-utm_source=distribute.pc_relevant.none-task-discussion_topic-BlogCommendFromBaidu-2&utm_source=distribute.pc_relevant.none-task-discussion_topic-BlogCommendFromBaidu-2

 

如果数据太长,因为ui.jqgrid.css中.ui-jqgrid tr.jqgrow td 设置了white-space: pre;导致数据与表头不对齐
解决方法1:
设置white-space为normal
解决方法2:
colModel设置数据的宽度
在火狐中,即便设置了宽度,表头和数据还是不对齐,
解决方法:
ui.jqgrid.css 中.ui-jqgrid tr.jqgfirstrow td  设置的样式padding: 0 2px 0 2px;border-right-width: 1px; border-right-style: solid;注释掉就可以了

我的处理方法,在html页面添加style

  .ui-jqgrid tr.jqgrow td {
    white-space: normal;
  }
  .ui-jqgrid tr.jqgfirstrow td {
    padding: 0 2px 0 2px;
    border-right-width: 1px; 
    border-right-style: solid;
  }

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!