如何將單列標題文本換行到jqgrid中的多行如果列標簽文本寬于列寬,則標簽文本將被截斷。增加列寬并不好,因為有些文本很長。如何使文字換行成多行?標題高度應由最大列高確定。我發現的唯一解決方案是但這并沒有實現文字的自動換行。如何實現標題文本的自動換行?更新。我為角色和自動換行嘗試了Oleg風格。字符包裝 th.ui-th-column div{word-wrap: break-word; /* IE 5.5+ and CSS3 */
white-space: pre-wrap; /* CSS3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
overflow: hidden;
height: auto;
vertical-align: middle;
padding-top: 3px;
padding-bottom: 3px}僅顯示第二行的一半。第三行根本沒有顯示:自動換行 th.ui-th-column div{
white-space:normal !important;
height:auto !important;
padding:2px;
}禁用包裝列的列大小調整。在那些列上移動鼠標圖標到列分隔符鼠標光標不會更改為sizer。包裹的列無法調整大小。如何解決這些問題?更新2我嘗試了字符換行(Oleg回復中的最后一個樣本)。如果列寬減小,我發現問題,以便標題中出現更多行:如果在列分隔符底部拖動,則無法調整列的大小:調整大小時不會增加縮放器高度。在IE9標題中,高度增加是不夠的:調整大小后,最后一個標題行不可見。在fireFox中,此問題不會發生。
3 回答

慕虎7371278
TA貢獻1802條經驗 獲得超4個贊
<style type="text/css"> .ui-jqgrid .ui-jqgrid-htable th div { height: auto; overflow: hidden; padding-right: 4px; padding-top: 2px; position: relative; vertical-align: text-top; white-space: normal !important; }</style>

慕田峪7331174
TA貢獻1828條經驗 獲得超13個贊
Following code wraps row data.ui-jqgrid tr.jqgrow td { word-wrap: break-word; /* IE 5.5+ and CSS3 */ white-space: pre-wrap; /* CSS3 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: normal !important; height: auto; vertical-align: text-top; padding-top: 2px; padding-bottom: 3px; }Following code wraps table header data .ui-jqgrid .ui-jqgrid-htable th div { word-wrap: break-word; /* IE 5.5+ and CSS3 */ white-space: pre-wrap; /* CSS3 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: normal !important; height: auto; vertical-align: text-top; padding-top: 2px; padding-bottom: 3px; }
- 3 回答
- 0 關注
- 969 瀏覽
添加回答
舉報
0/150
提交
取消