PDA

View Full Version : Possible to link a table with 2 TD's with one link


Freshit
12-09-2002, 09:10 AM
Hi,

I mean ONE link seen through the eyes of a TGP script?
Thanks!

Aheib
12-09-2002, 09:43 AM
If the table only holds those two <td> elements, yeah,
just put the onclick action in the <table> tag, and the entire table is one link

Freshit
12-09-2002, 09:48 AM
Oww... that's nice... can you post an example of that? Complete with some url? (a whole TABLE please).

You would help me with it :)
Thanks in advance!

Aheib
12-09-2002, 09:52 AM
sure mate

<table onClick="window.open('http://www.google.com')">
<tr>
<td> You can click me! </td> <td> You can Click me too! </td>
</tr>
</table>

Aheib
12-09-2002, 09:53 AM
You might wanna put this line in there as well
onMouseOver="this.style.cursor='hand';"
so the user sees a hand when moving over the text, making it more obvious it is a link

Hyde
12-09-2002, 10:39 AM
pretty nice solution!

I was thinking like, naaah... "you got a make an image of it or something"....
But your way will work with most browsers (javascript enabled).

Freshit
12-09-2002, 10:40 AM
Thanks a lot! Aheib. Just what I needed :)

En bedankt man ;) Ik zoek hier al een tijdje naar :) Waar kom je vandaan?

Roman R.
12-09-2002, 10:56 AM
Very nice. I though that its impossible.

Wow this place is better than school used to be. At least I learn something.

stain
12-09-2002, 11:39 AM
indeed very nice...that would save lots of time :)

slothdog
12-09-2002, 11:40 AM
Originally posted by Aheib
sure mate

<table onClick="window.open('http://www.google.com')">
<tr>
<td> You can click me! </td> <td> You can Click me too! </td>
</tr>
</table>

woah now thats a cool trick. i didnt know you could do that. i thought onClick and things could only be used in <a href> tags. hunh.. learn something new everyday.

Aheib
12-09-2002, 11:45 AM
glad I could learn you guys a thing or two :)

Freshit, graag gedaan hoor.. ik hoor 't wel als er nog wat is... ik kom uit een of ander klein dorp in Noord Holland, vlakbij Alkmaar, als dat je bekend is

i thought onClick and things could only be used in <a href> tags. hunh.. learn something new everyday. Search for javascript and DOM (document object model) in google, and enlighten yourself :)
You can apply onClick, onEtc on just about every element in html