Add a style sheet to the <Style type = "text/CSS"> . Gridviewstyle { Border-Right: 2px solid # a7a6aa; Border-bottom: 2px solid # a7a6aa; Border-left: 2px solid white; Border-top: 2px solid white; Padding: 4px; } . Gridviewstyle { Color: # ffffff; } . gridviewheaderstyle th {< br> border-left: 1px solid # ebe9ed; border-Right: 1px solid # ebe9ed; } . gridviewheaderstyle {< br> background-color: # 5d7b9d; font-weight: bold; color: White; } . gridviewfooterstyle {< br> background-color: # 5d7b9d; font-weight: bold; color: White; } . gridviewrowstyle {< br> background-color: # f7f6f3; color: #333333; } . gridviewalternatingrowstyle {< br> background-color: # ffffff; color: #284775; } . gridviewrowstyle TD,. gridviewalternatingrowstyle TD {< br> border: 1px solid # ebe9ed; } . gridviewselectedrowstyle {< br> background-color: # e2ded6; font-weight: bold; color: #333333; } . gridviewpagerstyle {< br> background-color: #284775; color: # ffffff; } . Gridviewpagerstyle table/** // * to center the paging links */ { Margin: 0 auto 0 auto; } </Style> At this time, a complete style table for the gridview has been defined. Now we can implement its application. < ASP: gridview Cssclass = "Gridviewstyle" Runat = "Server" > < Footerstyle Cssclass = "Gridviewfooterstyle" /> < Rowstyle Cssclass = "Gridviewrowstyle" /> < Selectedrowstyle Cssclass = "Gridviewselectedrowstyle" /> < Pagerstyle Cssclass = "Gridviewpagerstyle" /> < Alternatingrowstyle Cssclass = "Gridviewalternatingrowstyle" /> < Headerstyle Cssclass = "Gridviewheaderstyle" /> </ ASP: gridview > |