Solved

Mouseover entire table cell, elliciting href cursor (presumably by CSS)

Posted on 2003-10-22
4
1,193 Views
Last Modified: 2012-05-04
Hello,

I'd like to creat the effect whereby the entire table cell is an active HREF region, such that the cursor changes into a pointer. Also, the cell comprises some text that also has to be an active HREF link (the same as the table cell it resides in).

Can this be done? If so, please inform me how.

Thank you.

NBB

0
Comment
Question by:normbry
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
DelTreme earned 200 total points
ID: 9597533
Yes.

<style>
.linkcell
{
cursor : "hand";
}
</style>

(...)

<td class="linkcell" onclick="JavaScript:window.location.assign('mypage.html');">Click here to go to mypage</td>
0
 
LVL 2

Expert Comment

by:weareu
ID: 9597539
Not sure what you wanna do...

Turning a cell into an active href region? Does this mean it must also go to a specific url when you click anywhere in the cell or that you just want the cursor to change?

How does the cell compromise text that has an href link?
Do you have an Anchor (<A>) tag around your table?

Please post a snippet of the code you are trying to use, this would probalby clear these questions up.
0
 
LVL 3

Expert Comment

by:DelTreme
ID: 9597555
Maybe some explanation would be usefull as well :)

The <style> part creates a custom class called "linkcell". Any object that has this class, will have a hand cursor instead of an arrow or I-beam.

Thus <td class="linkcell"> creates a cell, and if your mouse is in the cell region, the cursor changes into a hand.

For instance, add the <style> part into a html file, and try <b class="linkcell">bold text</b>, then put your mouse over it. The cursor will change into the hand cursor.

The onclick event is fired everytime the cell or one of its 'children' (the text in the cell) is clicked. So clicking anywhere in the cell will run the code:

JavaScript:window.location.assign('mypage.html');

Which loads the page, it's just like a normal link.
0
 

Author Comment

by:normbry
ID: 9597557
No muss, no fuss. Thanks DelTreme.

NB
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now