Skip to main content
GameDev.net gamedev.net
🔒 Locked

[web] Onclick TD link

Started by kbiro Jun 28, 2005 at 12:29 PM 2 replies 1.1k views
Original Post
kbiro
kbiro
hey...here we go again. I'm just trying to get a 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]
Ternary
Ternary
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>Click Meh</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]
kbiro
kbiro
wow, thanks guys!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.