Click to See Complete Forum and Search --> : Stupid HTML question
Azuth
06-14-2002, 05:06 PM
I can't beleive I can't figure this one out. The answer must be obvious.
I have a text link in a cell of a table. I want the link to work when I click anywhere in the cell of the table and not just when I click on the text link. How should I do this?
Most references recommend against putting too many tags inside the link tags. I can put the entire cell inside these tags, but then it doesn't change my mouse cursor(to the hand icon) when mousing over the link. This can't be the right way.
Thanks in advance for the help.
yoshi273
06-14-2002, 08:13 PM
this is just what i think...
i dont think HTML can handle what u want. I think u need to use some javascript to make that work.
mefisto3
06-14-2002, 10:04 PM
First of all, i dont think the <td> tags are allowed inside the <a> tags. Some browsers might not handle it corrctly. one solution i can think of to your problem is to use images rather than text.
Just create a simple gif file with the text that u want and the right background colour and the same size as your table cell and put this in the cell. Then put the <a> tags around the image tags. that way wherever u click in the cell the link will work (as long they cell and the image are the same size).
Grizzly
06-15-2002, 01:15 AM
Yoshi speaks the truth - JavaScript makes this incredibly easy. Here is a simple example of a table cell which acts and feels like a fully hyperlinked entity:
<td bgColor="#0E1448"
onMouseOver="this.bgColor='#4851AA'"
onMouseOut="this.bgColor='#0E1448'"
onClick="document.location.href='mylink.htm'"
style="cursor:hand;">
This is a test link...
</td>
Leslung
06-16-2002, 03:58 PM
I can't imagine how possible is that code.
Well, I think you are < STYLE > tag from there?:rolleyes:
Ahihihi!
Nephalim
06-16-2002, 08:24 PM
Grizzly's code is perfect except that bgcolor is a deprecated property/attribute and should technically be added the style attribute like so:
style="background:#0E1448;cursor:hand"
Don't let me sound too picky... just thought I'd add that little tidbit. Most browsers are backwards compatible and bgcolor will still work.
Azuth
06-16-2002, 10:28 PM
Thanks Grizzly and Nephalim. I just spent the night studying a book on CSS's and javascript. Pretty cool stuff. I'm working on making a IE and NN friendly popout menu system. Looks like it will be a snap now.
yoshi273
06-25-2002, 06:09 PM
thanks, i just had a project that could use that.
daftness101
06-27-2002, 04:57 PM
um, I thought it was style="background-color: #0e1488; cursor: pointer"? Don't mean to sound picky or anything.
-Daft