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>
    
已邀请:
尽管Oleg的建议确实确定了标题的高度,但它并不构成解决方案-至少如果您希望正确的div保持液态并扩展到浏览器窗口的宽度,则至少不能解决问题。问题是,要在右侧网格容器上使用
float:left
,必须指定宽度。浮动元素必须具有与之关联的显式宽度(如果没有,则采用其内部最宽元素的宽度)。 对我有用的一种变通办法是将float的高度设置为较小的值(1px),并为该div的内容设置一个明确的高度。 我创建了一个jsFiddle示例,用于说明问题和解决方法。     
你应该用
<div style=\"float:left\">
    <table id=\"list1\"><tr><td/></tr></table>
    <div id=\"pager1\"></div>
</div>
<div style=\"float:left\">
    <table id=\"list2\"><tr><td/></tr></table>
    <div id=\"pager2\"></div>
</div>
作为网格的模板。如果你这样的话
<style type=\"text/css\">           
    #left { float: left; }
    #content { float: left; }
</style>
如果要制止浮动,您不应该忘记在下一个div的样式中包含\“ clear:left \”。 在此处查看带有两个网格的演示     

要回复问题请先登录注册