GridView CSS的样式表

2008-08-19 16:36

在<head></head>标签中加入一个样式表,并定义它.

<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 a
                {
                    color: #FFFFFF;
                }

                .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 td
                {
                    border: 1px solid #EBE9ED;
                }

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

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

                .GridViewPagerStyle table /**//* to center the paging links*/
                {
                    margin: 0 auto 0 auto;
                }
    </style>

这时一个完整的对gridView的样式表就已经定义完成了.现在来实现它的应用

<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>

转载于:https://www.cnblogs.com/ly5201314/archive/2008/11/12/1331923.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值