GridView CSS的完整樣式表

來源:互聯網
上載者:User

 

.GridViewStyle
  {  
      border-right: 2px solid white;
      border-bottom: 2px solid white;
      border-left: 2px solid white;
      border-top: 2px solid white;
      padding: 18px;
      width:500px;
      font-size:15px;
 }
 
.GridViewHeaderStyle th
{
     border-left: 1px solid #EBE9ED;
     border-right: 1px solid #EBE9ED;
}

.GridViewHeaderStyle
{
     background-color: #5D7B9D;
     font-weight: bold;
     color: White;
}

.GridViewFooterStyle
{
     background-color: #5D7B9D;
     font-weight: bold;
     color: White;
}

.GridViewRowStyle
{
     background-color: #F7F6F3;
     color: #333333;
}

.GridViewAlternatingRowStyle
{
     background-color: #FFFFFF;
     color: #284775;
}

.GridViewRowStyle td, .GridViewAlternatingRowStyle
{
     border: 1px solid #EBE9ED;
}

.GridViewSelectedRowStyle
{
     background-color: #E2DED6;
     font-weight: bold;
     color: #333333;
}

.GridViewPagerStyle
{
     background-color:#5D7B9D;
     color: #FFFFFF;
}

.GridViewPagerStyle table
{
     margin: 0 auto 0 auto;
}

li.gobackMain a
{
 color:Blue;
}

以下為使用樣本: 關鍵區段
<asp:GridView ID="GridView1" runat="server"  onpageindexchanging="GridView1_PageIndexChanging" CssClass="GridViewStyle">
                <FooterStyle CssClass="GridViewFooterStyle" />
                <RowStyle CssClass="GridViewRowStyle" />  
                <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                <PagerStyle CssClass="GridViewPagerStyle" />
                <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                <HeaderStyle CssClass="GridViewHeaderStyle" />

                <Columns>
                   <asp:BoundField DataField="檔案名稱" HeaderText="檔案名稱" />
                   <asp:TemplateField HeaderText="下載路徑">
                        <AlternatingItemTemplate>
                            <a href='<%#eval_r("路徑") %>'>下載</a>
                        </AlternatingItemTemplate>
                        <ItemTemplate>
                            <a href='<%#eval_r("路徑") %>'>下載</a>
                        </ItemTemplate>
                  </asp:TemplateField>
                </Columns>

                <EmptyDataTemplate>
                    提示:當前沒有任何記錄
                </EmptyDataTemplate>
            </asp:GridView>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.