Dynamic Drive DHTML code library!
Dynamicdrive.com


.
spacer.gif (807 bytes)
Featured Script
Flashing links 
Bring attention to special links, by making them flash!
.
Site Info
Search DD
Recommend DD
Email offers
Awards
DHTML Books
Advertising
Contact
.
Site Partners
Free JavaScripts
Free Graphics
.
Link to DD
Do you use scripts from Dynamic Drive? Please give something back by linking to us...
.
spacer.gif (807 bytes)

Home Small4.gif (1046 bytes) Other Small4.gif (1046 bytes) Here

Highlight Table Cells Script IE
Last updated: 99/01/21

Credits: Dynamic Drive

Description: Give any table a "rollover" personality with this script! Using it, you can allow the cells of any given table to change color when the mouse rolls over them. This is a very powerful script that can add a little magic to any table, whatever the table is used for. Updated to allow you to exclude particular cells from the rollover effect. In the below demo, we demonstrate the use of this script on two different types of tables.

Demo:

Table 1 (links): Table 2 (spreadsheet):
Dynamic Drive
Website Abstraction
Developer.com
Web Review
Items sold Sales
5 $100
10 $200
3 $60
12 $240
1 $20

Directions: Developer's View

Simply insert the below into the <head> section of your page:


Now, to apply the "highlight" effect to a table, simply add the following code inside the <table> tag itself, like below:

<table onMouseover="changeto('lightgreen')" onMouseout="changeback('white')">
"
"
</table>

Where "lightgreen" represents the color the cells change to when the mouse is over them, and "white" the color when the mouse moves out. Feel free to change these values to another.

To exclude any cell(s) from the rollover effect, simply give that cell an id="ignore" declaration, inserted inside the <td> tag. For example:

<table onMouseover=.... onMouseout=...>
<td id="ignore">Main Menu</td>
<td>Eggs</td>
<td>Ham</td>
</table>

Recommend Us!
-If you like Dynamic Drive, please recommend us to a friend...

Want to add a message board to your site? We recommend vBulletin, the most robust, feature rich BB script available!

Legend
All- Script works with Netscape 4 AND Internet Explorer 4+
NS- Indicates script works with Netscape 4 (NOT NS 6 yet)
IE- Indicates script works with Internet Explorer 4 and above
IE5- Indicates script works with Internet Explorer 5 and above
NS6!- Temporary index set up on script category pages to indicate script works in NS6


Copyright © 1998-2001 Dynamic Drive. Please read Terms Of Use here before using any of the scripts.