Sign in to follow this  
kbiro

[web] Onclick TD link

Recommended Posts

kbiro    139
hey...here we go again. I'm just trying to get a <TD> tag to link to another page when you click anywhere inside the cell. I know this isn't right, but it's what I have so far:
<td onclick="href = 'http://www.spacelord/mother/mother.php';"> 
what am I doing wrong....err, how do I fix it? [smile]

Share this post


Link to post
Share on other sites
Ternary    232
Quote:
Original post by Kalasjniekof
Something like this should work:

*** Source Snippet Removed ***


That's not valid xhtml (ignoring the typo). Two ways are:


<table>
<tr>
<td onclick="window.location='http://someplace.com';">Click Meh</td>
</tr>
<tr>
<td><a href="http://someplace.com" style="text-decoration: none; color: black;">Click Meh</a></td>
</tr>
</table>



[google]


p.s.

If the table cell is wider than the link, you can add "display: block; width: 100%;" to the style. Oddly enough Firefox only needs "display: block;" and IE only needs "width: 100%;" for that to work.

[Edited by - Ternary on June 28, 2005 1:48:22 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this