如何在jqGrid上实现wordwrap,它适用于IE7,IE8和FF,同时还具有列调整大小(网格正确对齐)。
尝试使用特定宽度的div(基于初始TH宽度)对每个td进行内部包装内容,但colresize对我插入的div不起作用。 jqGrid计算调整大小的TH和相邻TH的宽度。
是否有更好的解决方案可以避免所有JavaScript'黑客攻击'?
答案 0 :(得分:19)
jqGrid Text/Word Wrapping使用以下CSS解释了如何执行此操作:
.ui-jqgrid tr.jqgrow td {
white-space: normal !important;
height:auto;
vertical-align:text-top;
padding-top:2px;
}
答案 1 :(得分:1)
使用此CSS,这肯定会有所帮助。
.ui-jqgrid tr.jqgrow td {
word-wrap: break-word; /* IE 5.5+ and CSS3 */
white-space: pre-wrap; /* CSS3 */
white-space: normal !important; /* 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
}
答案 2 :(得分:-1)
Deall All,
这可以如下:
$("#jqxgrid").jqxGrid(
{
source: dataAdapter,
width: 1500,
autorowheight: true,
autoheight: true,
columnsresize: true,
theme: 'ui-redmond',