help with html

P

Paul M

Hi I want to be able to use a table cell as a link as apposed to text so
when the mouse clicks in the td cell it will go to a URL
Any ideas on code to do this
Thanks
Paul M
 
K

Kevin Spencer

A table cell doesn't have an "onclick" event, but a div does. Put a div into
the table cell, and add an "onclick" event handler for the div.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
S

Steve Easton

Try this in the opening <td> tag for the cell.

<td onclick="javascript:window.open('http://www.google.com')" style="cursor:hand;">

Works for me. The style cursor:hand lets the user know it's a link.

There might be some browser compatibility issues though, I only tried it in IE

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
S

Steve Easton

Also works with a title tag to display text:

<td onclick="javascript:window.open('http://www.google.com')" style="cursor:hand;" title="Click
anywhere to open the page">

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
P

Paul M

Thanks Steve
Sorted
Paul M
Steve Easton said:
Try this in the opening <td> tag for the cell.

<td onclick="javascript:window.open('http://www.google.com')" style="cursor:hand;">

Works for me. The style cursor:hand lets the user know it's a link.

There might be some browser compatibility issues though, I only tried it in IE

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
.......................with a computer
 
S

Steve Easton

You can't with javascript:window.open.

Now I have to ask, if you're putting the word Google in the cell, why do you want to make the whole
cell "hot" with an onclick.
Why not just make Google the hyperlink, and then you can make the link open in the same window.


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
P

Paul M

Hi
I am trying to have a navigation table where you hover over the table cell
and it highlights.I have achieved this with swap class but the curser
/pointer doesn't change to a hand symbol. the code you very kindly shared
with me works well but for the fact that it opens another window.
the affect I am trying to achieve is similar to here accept I don't need the
slide menu structure,just the cell highlight

http://www.projectseven.com/tutorials/navigation/swapclassmenu/smp01_ldeluxe.htm#

Best wishes
Paul M
 
S

Steve Easton

Ah OK. You can do that very easily using CSS and swapping the colors using the hover attribute.

the left nav panel on this page does it that way.
http://www.95isalive.com/

The style sheet is here:
http://www.95isalive.com/95.css it's the .navpanel class

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
T

Thomas A. Rowe

If you are linking to external sites, why would you want to replace your site with the other site
vs. loading the external site in a new window?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Top