- 1). Right-click the HTML file and select "Open With." Double-click your preferred HTML editor to load the code.
- 2). Scroll down to the table's tag and the content. Add the following code to change the color when you hover the mouse over the header:
onmouseover="this.bgColor='#FFFFFF'"
Change the hexadecimal color code to any valid HTML color code. In this example, the hover color is white. - 3). Change the color back to the original background color when the mouse moves away from the header. The following code changes the background back to black:
onMouseout="this.bgColor='#000000'"
The code above changes the background color back to black. - 4). Save the changes and open the code in your Web browser. Hover the mouse over the table to test the changes.
SHARE