PC Review


Reply
Thread Tools Rate Thread

How do I highlight an entire row of a table on a mouseover event?

 
 
=?Utf-8?B?UklHR1M=?=
Guest
Posts: n/a
 
      24th May 2005
I want the user to be able to highlight the entire row of a database driven
table no matter what column their mouse is ponted at. I know how to apply
DHTML events to individual cells of a table but I am having trouble trying to
apply it to the row.

Any help would be appreciated. Thanks in advance.
 
Reply With Quote
 
 
 
 
Jon Spivey
Guest
Posts: n/a
 
      24th May 2005
Hi,
Say you have a table like this
<table id="table1">
<tr><td>stuff</td><td>more stuff</td></tr>

You can either write the mouseover directly on the first row -
<tr onmouseover="this.style.backgroundColor='red';"><td>stuff</td><td>more
stuff</td></tr>
or you can attach it with script
function setMouse(){
var t = document.getElementById('table1').getElementsByTagName('tr');
t[0].onmouseover = function(){this.style.backgroundColor='red';}
}
onload=setMouse;

Both of these would do the same thing - make the first row red onmouseover


--
Cheers,
Jon
Microsoft MVP



"RIGGS" <(E-Mail Removed)> wrote in message
news:CF2E2570-EF5C-4ED7-9308-(E-Mail Removed)...
>I want the user to be able to highlight the entire row of a database driven
> table no matter what column their mouse is ponted at. I know how to apply
> DHTML events to individual cells of a table but I am having trouble trying
> to
> apply it to the row.
>
> Any help would be appreciated. Thanks in advance.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MouseOver Event.... conckrish@gmail.com Microsoft ASP .NET 2 28th Feb 2006 09:23 AM
Excel should highlight row/column location on mouseover =?Utf-8?B?ZGF2aWRsaW5kYw==?= Microsoft Excel Setup 0 28th Dec 2005 05:10 PM
mouseover-event =?Utf-8?B?d2lsbGc=?= Microsoft Excel Programming 2 9th Oct 2005 05:54 PM
MouseOver Event =?Utf-8?B?cmtibmFpcg==?= Microsoft ASP .NET 7 31st Jan 2005 03:57 PM
mouseover highlight of datagrid row TJS Microsoft ASP .NET 1 17th Feb 2004 01:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:05 PM.