Changing Table Background Colors on Mouseover in IE
We can change the background color of a table in HTML tables using the following method. We can place mouse pointer over each of the HTML table cells below to view this HTML mouseover effect. The HTML table cells will change to a specified color when we place our pointer over the cells.
In this way we can improve the presentation of HTML table data. Also it will give more professional look.
We can place the following code within the <TR> or <TD> tag of our HTML table code:
onMouseover=”this.bgColor=’#EEEEEE‘”onMouseout=”this.bgColor=’#FFFFFF’”
Table code might look something like this:
<TABLE BORDER=”2″ WIDTH=”100%”>
<TR onMouseover=”this.bgColor=’#EEEEEE‘”onMouseout=”this.bgColor=’#FFFFFF‘”>
<TD>Table Content1</TD>
</TR>
<TR onMouseover=”this.bgColor=’#EEEEEE‘”onMouseout=”this.bgColor=’#FFFFFF‘”>
<TD>Table Content2/TD>
</TR>
</TABLE>
We can change the background color indicated in bold according to our requirement.
