添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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

 bootstrap2中标题和td因数据太长对不齐

table{
    width: 100%;
    table-layout: fixed;
    word-break: break-all;