Solved

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

Posted on 2003-10-22
4
1,207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

726 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