jqGrid中的大标头
|
我一直在用新的razor视图引擎摆弄asp.net mvc 3。
我的目标是在每列中使用jqGrid固定流体2列布局。我没有运气!一旦在右列中添加网格,其标题就会很大。我不认为它的jqGrids有问题,因为如果我删除样式,两个网格都将按预期显示。
我看到jqGrid的CSS将display:块作为ui-helper-clearfix类的一部分应用于标头。
有人对我可以尝试使用此功能或其他固定流体CSS有任何建议(我已经从网上尝试了一堆模板,没有运气)?
模板文件中的代码:
... <style type=\"text/css\">
#left { float: left; width: 400px;}
#content { margin-left: 400px;}
</style>
</head>
<body>
<div>
<div id=\"left\">
@RenderSection(\"SPTreeGrid\")
</div>
<div id=\"content\">
@RenderSection(\"ClientPickerGrid\")
</div>
</div>
</body>
更新:
我的页面实际上需要在左侧显示2个固定宽度的网格,在右侧显示一个流畅的网格。
这是我的css的问题(我仍然不知道为什么),但是我最终使用了有效的以下布局(rail是左列):
#container{
overflow:hidden;
padding-left:400px; /* The width of the rail */
}
* html #container{
height:1%; /* So IE plays nice */
}
#content
{
width:100%;
border-left:400px; /* The width and color of the rail */
margin-left:-400px;
float:right;
}
#rail{
width:400px;
float:left;
margin-left:-400px;
display:inline; /* So IE plays nice */
}
cshtml:
<div id=\"container\">
<div id=\"content\">
@RenderSection(\"ReportGrid\")
</div>
<div id=\"rail\">
@RenderSection(\"SPTreeGrid\")
@RenderSection(\"ClientPickerGrid\")
</div>
</div>
没有找到相关结果
已邀请:
2 个回复
垫歌蝎降凤
,必须指定宽度。浮动元素必须具有与之关联的显式宽度(如果没有,则采用其内部最宽元素的宽度)。 对我有用的一种变通办法是将float的高度设置为较小的值(1px),并为该div的内容设置一个明确的高度。 我创建了一个jsFiddle示例,用于说明问题和解决方法。
完趣镐
作为网格的模板。如果你这样的话
如果要制止浮动,您不应该忘记在下一个div的样式中包含\“ clear:left \”。 在此处查看带有两个网格的演示