为什么我的网格寻呼机显示如下:
它应该看起来像:
这是我的代码:
<asp:GridView ID="grid" runat="server" AllowSorting="True"
AutoGenerateColumns="False" CellPadding="0" GridLines="None"
PageSize='<%# int.Parse(System.Configuration.ConfigurationManager.AppSettings["gvPageSize"].ToString()) %>'
Width="100%" OnRowCreated="grid_RowCreated" CssClass="mGrid"
PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" AllowPaging="true"
OnPageIndexChanging="grid_PageIndexChanging">
和css:
.mGrid {
width: 100%;
background-color: #fff;
margin: 5px 0 10px 0;
border: solid 1px #525252;
border-collapse:collapse;}
.mGrid td {
padding: 2px;
border: solid 1px #c1c1c1;
color: #717171;}
.mGrid th {
padding: 4px 2px;
color: #fff;
background: #424242 url(grd_head.png) repeat-x top;
border-left: solid 1px #525252;
font-size: 0.9em;}
.mGrid .alt { background: #fcfcfc url(grd_alt.png) repeat-x top; }
.mGrid .pgr { background: #424242 url(grd_pgr.png) repeat-x top;}
mGrid .pgr table { margin: 5px 0;}
.mGrid .pgr td {
border-width: 0;
padding: 0 6px;
border-left: solid 1px #666;
font-weight: bold;
color: #fff;
line-height: 12px;}
.mGrid .pgr a { color: #666; text-decoration: none;}
.mGrid .pgr a:hover { color: #000; text-decoration: none;}
答案 0 :(得分:0)
在应用于寻呼机的CSS中,下面用粗体标记的那些像边距和填充可能是这种情况下的关键元凶。
.mGrid .pgr table { margin:5px 0;}
.mGrid .pgr td {...... 填充:0 6px; ......
您应该尝试在某些DOM Inspector中检查css,例如Chrome开发者工具/ Firebug,并进行调整,直到您按照自己希望的方式进行调整