Hi. I'd like to make entire <td> cells of a table 'clickable' for navigation (instead of having an href element inside of the cell).
Can anybody help?
Thanks!
Hi. I'd like to make entire <td> cells of a table 'clickable' for navigation (instead of having an href element inside of the cell).
Can anybody help?
Thanks!
You could do that with an onclick event for the cell but, that would require the user to have javascript enabled. It would be better to use plain HTML, like so:
If you have content for the cell, it could replace the entity. The text-decoration:none; is optional if you have content.HTML Code:<td><a href="whatever.htm" style="display:block;width:100%;height:100%;text-decoration:none;"> </a></td>
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Thanks!
or, you could do this:
<table>
<tr>
<td style="cursor:hand" onclick="window.location.href = 'http://www.dynamicdrive.com/'">Blah.. You can put any text here.</td>
</tr>
</table>
Just another option
- Mike
That solution requires javascript enabled. Unless you are trying to restrict the use of your site to javascript enabled browsers, it is a bad choice.Originally Posted by mburt
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Okay, thanks jscheuer1.
But in your option you have to have use css, which some browsers don't support, so it is a tricky decision.
- Mike
What browsers don't support css? I would like to know as, I can't think of any. However, even those that do not will still show a link of some sort that could still be clicked on to navigate to the resource.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Bookmarks