我的gridview遇到了麻烦,它在它的容器上重叠,
这是我的 datagridview 代码:
<asp:GridView ID="gvData" runat="server" AllowPaging="True" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="PayId" Font-Size="11px" ForeColor="Black" PageSize="20"
Width="100%" BorderColor="Black" CssClass="zebra" AlternatingRowStyle-CssClass="even" >
当我生成行时,在 datagridvie 绑定上,我使用:
Protected Sub gvData_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvData.RowDataBound
For i As Integer = 0 To e.Row.Cells.Count - 1
e.Row.Cells(i).Attributes.Add("style", "white-space:nowrap;")
Next
End Sub
对于容器,我已经在母版页上设置了 em,带有 css 类:
对于整个页面:
#PublicWrapper.width100 {
width: 92%;
padding-left: 2%;
padding-right: 2%;
float:left;
left: 50%;
position:relative;
margin-left: -48%;
}
对于身体:
body.modern{
background-image: url(../Images/);
font-family: Arial;
color: rgb(0, 0, 0);
background-color: #353f5b;
line-height: normal;
font-size: 12px;
background-position: 0% 0%;
background-repeat: repeat;
background-attachment: scroll;
padding: 0px;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
对于网格容器:
body #PublicWrapper .placeholder_5.sf_cols {
background-color: #a2a2a2;
}
我已经添加 display: inline-block;
,但容器和主体没有显示在中心屏幕上,但我的问题已解决。我应该使用 css 上的任何技巧来使身体适合中心屏幕但网格没有重叠吗?