其他分享
首页 > 其他分享> > jqGrid表头与数据不对齐的问题

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

作者:互联网

原文: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;
  }

 

标签:right,jqGrid,2px,tr,表头,ui,对齐,border,jqgrid
来源: https://www.cnblogs.com/yifengs/p/12652000.html