gridview隔行变色

<style>
.tr1
{
    background-color: #f7fbff;
}
.tr0
{
    background-color: #FFFFFF;
}
.td{
    COLOR: red;
}
</style>
<script language="javascript" type="text/javascript">
function onload()
{
    var ooOpinions=document.getElementById("gridview1");
    for(var i=0;i<ooOpinions.rows.length;i++)
    {
       var oRows=ooOpinions.rows(i);
       oRows.className='tr'+(i+1)%2;
       if(ooOpinions.rows(i).cells.item(4).innerText=='已回复')
          ooOpinions.rows(i).cells.item(4).className='td';
    }
}
onload();
</script>

你可能感兴趣的:(GridView)