如何在适用于 IE7、IE8 和 FF 的 jqGrid 上实现自动换行 [英] How to implement wordwrap on jqGrid which works on IE7, IE8 and FF

查看:16
本文介绍了如何在适用于 IE7、IE8 和 FF 的 jqGrid 上实现自动换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在适用于 IE7、IE8 和 FF 的 jqGrid 上实现自动换行,同时还可以调整列大小(网格正确对齐).

How to implement wordwrap on jqGrid which works on IE7, IE8 and FF, while also having column-resize work (grid aligns correctly).

尝试使用特定宽度的 div(基于初始 TH 宽度)对每个 td 上的内容进行内包装,但 colresize 不适用于我插入的 div.jqGrid 会计算调整后的 TH 和相邻 TH 的宽度.

Tried to innerwrap content on each td with a div of specific width (based on initial TH width), but colresize will not work on the divs I've inserted. jqGrid calculates the widths of the resized TH and adjacent THs though.

有没有更好的解决方案可以避免所有 JavaScript 'hacks'?

Is there a better solution which will avoid all the JavaScript 'hacks'?

推荐答案

jqGrid Text/Word Wrapping 解释了如何做到这一点,使用以下 CSS:

jqGrid Text/Word Wrapping explains how to do this, using the following CSS:

.ui-jqgrid tr.jqgrow td {
 white-space: normal !important;
 height:auto;
 vertical-align:text-top;
 padding-top:2px;
}

这篇关于如何在适用于 IE7、IE8 和 FF 的 jqGrid 上实现自动换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆