<tr οnmοuseοver="this.style.backgroundColor='#FFCC66'" οnmοuseοut="this.style.backgroundColor='#FFFFFF'"></tr>
通过onMouseOver(鼠标经过)、onMouseOut(鼠标移去)事件来控件当前行的样式,即this.style.backgroundColor来实现表格行的颜色改变。
对于C# web控件,如DataGrid,可通过其特性Attributes来实现。
控件名.Attributes.Add("onMouseOver","this.style.backgroundColor='#FFCC66'");
控件名.Attributes.Add("onMouseOver","this.style.backgroundColor='#FFFFFF'" );
控件名.Attributes.Add("onMouseOver","this.style.backgroundColor='#FFFFFF'" );