2010-09-04 136 views
6

我在我的网页使用的jqGrid包裹jqGrid的列标题,我修改了ui.jqgrid.css文件包列标题是这样的:问题与IE

.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,问题仍然存在。使用

回答

22

尝试另外

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

似乎很努力在所有浏览器中都很好。请参阅示例here

已更新2:有关此问题的更多信息和更多演示,请参阅the answer

+0

非常感谢,作品像魅力! – 2010-09-04 10:22:44

+0

+1。这是最优雅和简洁的解决方案。 – ukhardy 2014-09-23 12:16:07

+0

@ukhardy:谢谢! – Oleg 2014-09-23 12:23:33

1

这应该工作:

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,并做了工作。我认为这会帮助像我这样的人。 :)

+1

你能解释一下为什么这应该起作用吗? – eliasah 2014-07-17 12:26:43

+0

我编辑了我的答案。 – 2014-07-19 16:22:42