Well, I actually don't know what it is. But I need a code where you can click everywhere on the table, not only on the text/image.
| |
|
Welcome to KnowledgeSutra - Dear Guest | |
Table/cell Link?
Started by Amezis, Apr 12 2005 12:19 PM
13 replies to this topic
#2
Posted 12 April 2005 - 12:29 PM
Ahh.. I see. I know what you are talking about. A TEXT in a TD cell and just hovering on that CELL and clicking will activate that link.
That is a cool effect and looks nice.
try this...
That is a cool effect and looks nice.
<table name="badger"> <tr> <td class="row1" width="100%" style="cursor:hand; padding: 30px; border: 1px solid black;" onclick="window.location.href='linked_page.html'">THIS IS CONTENT</td> </tr> </table>
try this...
#4
Posted 12 April 2005 - 01:01 PM
While Opaque's solution will work, it is not ideal since it uses javascript and some people turn off javascript. I am assuming you are asking this because you are thinking of designing a menu system with a table. I would do it through CSS rather than javascript. CSS is better because all modern browsers will display this properly.
you can modify the CSS so that the colors and the look is right for you.
<style>
a.menu:link {display:block;width:100%;background:white}
a.menu:visited {display:block;width:100%;background:white}
a.menu:hover {display:block;width:100%;background:blue}
a.menu:active {display:block;width:100%;background:white}
</style>
<table border=1 width=100 cellpadding=0 cellspacing=0>
<tr><td><a href="link1.html" class=menu>1</a></td></tr>
<tr><td><a href="link2.html" class=menu>2</a></td></tr>
<tr><td><a href="link3.html" class=menu>3</a></td></tr>
<tr><td><a href="link4.html" class=menu>4</a></td></tr>
</table>
you can modify the CSS so that the colors and the look is right for you.
#5
Posted 12 April 2005 - 01:09 PM
actually, I just realized where it says
you sould change the BLUE to some other color because the link color is automatically BLUE and you won't see the link when you hover over it. Just letting you know in case you try the code and see it doesn't work.
There are many things you can change using CSS. It is very powerful.
a.menu:hover {display:block;width:100%;background:blue}
you sould change the BLUE to some other color because the link color is automatically BLUE and you won't see the link when you hover over it. Just letting you know in case you try the code and see it doesn't work.
There are many things you can change using CSS. It is very powerful.
#8
Posted 12 April 2005 - 07:01 PM
It don't work. The only thing that changed is:
In firefox, the text is in the middle(nothing changed), in IE, it's on the top.
I want the text in the middle, and the whole cell has the hover effect/link. Now, only the width of the text has the hover effect (almost nothing changed)
In firefox, the text is in the middle(nothing changed), in IE, it's on the top.
I want the text in the middle, and the whole cell has the hover effect/link. Now, only the width of the text has the hover effect (almost nothing changed)
#9
Posted 13 April 2005 - 12:09 AM
the code works. you must have done something wrong. But the only thing it will not do is center it. do you have a link I can see where you want to use this? And what is in your table? That would be easier. Cause in order to center it you might have to do it with padding.
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














