在 IE 上包装 jqGrid 列标题的问题

发布于 2024-09-16 23:49:53 字数 284 浏览 4 评论 0原文

我在页面中使用 jqGrid,我修改了 ui.jqgrid.css 文件来包装列标题,如下所示:

.ui-jqgrid tr.jqgrow td {
    white-space: normal !important;
}

.ui-th-column,.ui-jqgrid .ui-jqgrid-htable th.ui-th-column{
    white-space:normal;
}

它在除 IE 之外的所有浏览器中都可以正常工作!我尝试了IE7和IE8,问题仍然存在。

I'm using jqGrid in my pages, I modified the ui.jqgrid.css file to wrap the column headers like this:

.ui-jqgrid tr.jqgrow td {
    white-space: normal !important;
}

.ui-th-column,.ui-jqgrid .ui-jqgrid-htable th.ui-th-column{
    white-space:normal;
}

It works fine in all of the browsers but IE! I tried IE7 and IE8 and the problem is still out there.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

热血少△年 2024-09-23 23:49:53

尝试另外使用

.ui-th-div-ie {
    white-space:normal !important;
    height:auto !important;
}

更新:在我看来,最好使用以下一种样式,而不是所有这些样式:

th.ui-th-column div{
    white-space:normal !important;
    height:auto !important;
    padding:2px;
}

它似乎在所有浏览器中都工作得很好。请参阅此处的示例。

更新2:有关该问题的更多信息和更多演示,您可以在答案

Try to use additionally

.ui-th-div-ie {
    white-space:normal !important;
    height:auto !important;
}

UPDATED: It seems to me, that instead of all this styles it would be better to use one following:

th.ui-th-column div{
    white-space:normal !important;
    height:auto !important;
    padding:2px;
}

It seems work very good in all browsers. See an example here.

UPDATED 2: More information and more demos about the problem you can find in the answer.

﹂绝世的画 2024-09-23 23:49:53

这应该有效:

th.ui-th-column div{
    height:auto!important;
}

.ui-jqgrid .ui-jqgrid-htable th div {
    white-space:normal !important;
    height:auto!important;
    padding:2px;
}

我尝试了奥列格的回答。但是,虽然有包装,但高度并没有增加以适应内容物。所以我按照上面的方法修改了css并成功了。我认为这会对像我这样的人有所帮助。 :)

This should work:

th.ui-th-column div{
    height:auto!important;
}

.ui-jqgrid .ui-jqgrid-htable th div {
    white-space:normal !important;
    height:auto!important;
    padding:2px;
}

I tried Oleg's answer. But, though there was wrapping, height did not increase to fit the contents. So I modified the css as above and did work. I thought it will help someone out there like me. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文