|
-
Stupid HTML question
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.
-
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.
-
Reef Shark
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).
-
Ursus Arctos Moderatis
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:
Code:
<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>
-
uhuh!
I can't imagine how possible is that code.
Well, I think you are < STYLE > tag from there?:rolleyes:
Ahihihi!
Leslung 
-
Reef Shark
Grizzly's code is perfect except that bgcolor is a deprecated property/attribute and should technically be added the style attribute like so:
Code:
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.
-
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.
-
thanks, i just had a project that could use that.
-
Goldfish
um, I thought it was style="background-color: #0e1488; cursor: pointer"? Don't mean to sound picky or anything.
-Daft
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|