本文共 776 字,大约阅读时间需要 2 分钟。
定义样式表并在某处设置这些样式:
/**
* GRIDVIEW STYLES
**/
.gridview {
font-family:"arial";
background-color:#FFFFFF;
width: 100%;
font-size: small;
}
.gridview th {
background: #7AC142;
padding: 5px;
font-size:small;
}
.gridview th a{
color: #003300;
text-decoration: none;
}
.gridview th a:hover{
color: #003300;
text-decoration: underline;
}
.gridview td {
background: #D9EDC9;
color: #333333;
font: small "arial";
padding: 4px;
}
.gridview tr.even td {
background: #FFFFFF;
}
.gridview td a{
color: #003300;
font: bold small "arial";
padding: 2px;
text-decoration: none;
}
.gridview td a:hover {
color: red;
font-weight: bold;
text-decoration:underline;
}
然后需要设置gridview以利用CssClass和AlternatingRowStyle-CssClass来利用这些:
runat="server"
CssClass="gridview"
AlternatingRowStyle-CssClass="even">
转载地址:http://bbima.baihongyu.com/