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;
  }

 bootstrap2中標題和td因數據太長對不齊

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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM