MSNTV, WebTV, Interactive Television, Set Top Appliance, LBB, Little Black Box, Inexpensive Internet Access, Computer Phobia, Virus Free WWW, Easy To Use 'Net, Table Art, Audioscope Art, Basic HTML, Why Computers Hate Us, Internet For: The Disabled, Elderly, Poor "Just when u think yer life is hard, along comes MSNTV to remind u: it could b WORSE! :)" ~~Rogi
WebTV Only: Copy & Paste Any Amount Of
Text In This Box To Enlarge It For The Vision Impaired. *THIS BOX WILL EXPAND*
Note: In code examples I add a period after each left arrow
bracket so the code can be viewed in all email programs. If you copy and paste, be sure to remove the periods or it won't work.
Using a combination of JavaScript and CSS you can have the background color of a table cell or whole row (or even the whole table) change color when a visitor places their cursor over it.
Why would you want to do that? You can have a row or column highlight when the cursor is on it to make it easier to read data across the table - or just for fun!
Here's the code you'd place in the HEAD section of your page:
That's the CSS part, below is a sample table that shows you how to add the JavaScript that makes the background color change. I've coded the change into the first row. If you copy and paste both sets of code into a page you'll see how the background color of the first row changes color on mouseover, but not the second row.