1.第一种样式
GridView表格样式
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" BorderColor="#337FB2"
BorderWidth="2px" CellPadding="4" Font-Size="Small" ForeColor="#333333" Height="32%"
OnRowDataBound="gvList_RowDataBound" Width="100%">
<columns>
<asp:BoundField HeaderText="编号">
<itemstyle Width="5%" /> </asp:BoundField>
<asp:BoundField DataField="U_Name" HeaderText="用户名">
<itemstyle Width="10%" /> </asp:BoundField>
<asp:BoundField DataField="U_State" HeaderText="状态">
<itemstyle Width="10%" /> </asp:BoundField>
<asp:BoundField DataField="U_IP" HeaderText="IP">
<itemstyle Width="25%" /> </asp:BoundField>
<asp:BoundField DataField="L_Date" HeaderText="时间">
<itemstyle Width="5%" /> </asp:BoundField>
</columns>
<RowStyle BackColor="White" Font-Bold="True" Font-Size="Small" ForeColor="#003399"
HorizontalAlign="Center" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<pagerstyle BackColor="#337FB2" ForeColor="White" HorizontalAlign="Center" VerticalAlign="Middle" />
<headerstyle BackColor="#337FB2" CssClass="BODY" Font-Size="12px" ForeColor="White"
HorizontalAlign="Center" VerticalAlign="Middle" />
<AlternatingRowStyle BackColor="#E8F4FF" Font-Bold="True" Font-Size="Small" HorizontalAlign="Center" />
<footerstyle BackColor="#A6A1E0" Font-Bold="True" ForeColor="White" />
</asp:GridView>
</div>
</form>
</body>
2、第二种样式
GridView表格样式
<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
CellPadding="4" Font-Size="9pt" HeaderStyle-CssClass="headStyle" Width="100%"
HorizontalAlign="Center" ForeColor="#333333" OnRowDataBound="GridView1_RowDataBound">
<FooterStyle BackColor="#990000" Font-Bold="True" />
<Columns>
<asp:BoundField DataField="LOGIN" Visible="false" HeaderText="登录名" />
<asp:TemplateField HeaderText="姓名">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("NAME") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="上传文档">
<ItemTemplate>
<a href='UpLoadDetailList.aspx?LOGIN=<%#DataBinder.Eval(Container.DataItem,"LOGIN") %>'>
<%#DataBinder.Eval(Container.DataItem, "UPLOADDOCNUM")%></a>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="下载文档">
<ItemTemplate>
<a href='DownLoadDetialList.aspx?LOGIN=<%#DataBinder.Eval(Container.DataItem,"LOGIN") %>'>
<%#DataBinder.Eval(Container.DataItem, "DOWNLOADNUM")%></a>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="更新文档">
<ItemTemplate>
<a href='UpdateDetailList.aspx?LOGIN=<%#DataBinder.Eval(Container.DataItem,"LOGIN") %>'>
<%#DataBinder.Eval(Container.DataItem, "UPDATEDOCNUM")%></a>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
<RowStyle ForeColor="#333333" BackColor="#FFFBD6" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<HeaderStyle BackColor="#AAAAFF" Font-Bold="True" ForeColor="White" />
</asp:GridView>