Jump to content
xisto Community
Sign in to follow this  
Amezis

Table/cell Link?

Recommended Posts

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.

<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...

Share this post


Link to post
Share on other sites

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.

<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.

Share this post


Link to post
Share on other sites

actually, I just realized where it says

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.

Share this post


Link to post
Share on other sites

I liked the code. But there's one problem left:The height is 75px. It's not used in a menu, but in a content.So it will only hover when I click the beside the text, not below or above.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Navigational styleTable/cell Link?This is an example and it should work okay, you may have to check the html for untidiness though. There is no CSS or javascript involved. It should turn out like a navigation bar. 
This is link "A" This is link "B"
There is example where I used it here: Gamestaronline.Webs.Com/ezine_main.HtmHope this helped :-)-reply by Gamestar

Share this post


Link to post
Share on other sites

hi friends,

 I created a table, in that table I have two cells ,first cell have some link, if I click on that link that will opening on new window, but I want that result will come in the second cell in that table please help me .And I have another problem how to display a html file in a cell. Please answer these. Thank you in advance. Pls pls pls    

-reply by naresh

Share this post


Link to post
Share on other sites
I want the link in the cell to open in a new windowTable/cell Link?

I want to make a cell as a hyperlink.  the code that was given at the beginning works fine but I want the link to open in a new window not the same window.. Is that possible?

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.