我有一个 gridview 控件,其中应用了一个 css 类。以下是我的代码的 CSS 内容:
/* Team */
.TeamBox{display:block;margin-bottom:10px;}
.TeamBox table{border:0 none transparent;border-collapse:collapse; width:100%;}
.TeamBox table th, .TeamBox table td{border:0 none transparent;text-align:left;}
.TeamBox table th{font-weight:600!important;font-style:italic;border-bottom:1px solid #f7f7f7;padding-bottom:5px;font-size:14px;}
.TeamBox table td {padding-left:15px; float:left;}
声明部分是:
<asp:UpdatePanel ID="upMaster" runat="server">
<ContentTemplate>
<h2 class="ms-webpart-titleText" style="text-align: justify;">
<nobr><asp:Label ID="lblWebTitle" runat="server" ></asp:Label> <span id="WebPartCaptionWPQ6"></span></nobr>
</h2>
<div class="TeamBox">
<asp:GridView ID="MangersGrid" AutoGenerateColumns="false" AllowPaging="true" PageSize="5" runat="server" OnPageIndexChanging="MangersGrid_PageIndexChanging">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Team Managers" />
</Columns>
</asp:GridView>
</div>
<div class="TeamBox">
<asp:GridView ID="MembersGrid" AllowPaging="true" AutoGenerateColumns="false" runat="server" PageSize="5" OnPageIndexChanging="MembersGrid_PageIndexChanging">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Team Member" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
我在不同的浏览器中得到不同的输出。
下图显示了 FireFox 中的网格。
下面是在 IE 中显示网格的图像。
我想删除网格中每个元素中出现的线条。
我该怎么办?
最佳答案
只是我需要设置 GridView 控件的属性。即 GridLines="None"并获得了完美的输出。
希望这对其他人也有帮助。
关于与 GridView 控件一起使用时的 css 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21449894/