Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Table cell as link

Reply
Thread Tools

Table cell as link

 
 
Clemenza
Guest
Posts: n/a
 
      03-19-2005
Hello,

I have a table for my menu. This table contains menu items as text. Each
td tag contains a separate menu text.
How is it possible (without javascript and making text as image) to make
the whole td cell as link and not only the text?
I tried to put the td cell inside the a tag, but it is not a valid html
sollution.

Any idea?

Thanks!
 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      03-19-2005
Clemenza <(E-Mail Removed)> wrote:

>I have a table for my menu.


Why? Doesn't sound like a table to me.

>This table contains menu items as text. Each td tag contains a separate menu text.
>How is it possible (without javascript and making text as image) to make
>the whole td cell as link and not only the text?


table.menu a {display: block;}

replacing 'menu' with whatever classname you've given to your table.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
 
Nico Schuyt
Guest
Posts: n/a
 
      03-19-2005
Clemenza wrote:
> I have a table for my menu. This table contains menu items as text.
> Each td tag contains a separate menu text.
> How is it possible (without javascript and making text as image) to
> make the whole td cell as link and not only the text?
> I tried to put the td cell inside the a tag, but it is not a valid
> html sollution.
> Any idea?


Something like:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>Table cell hover</title>
<style type="text/css" media="all">
table, td{border-collapse:collapse;border:1px solid gray;}
td{vertical-align: top;}
a{display:block;width:100%;height:100%;}
a:hover{background:yellow;}
</style>
<table>
<tr><td><a href="">xx</a></td><td>Text text text text text text
text</td></tr>
<tr><td><a href="">yyyyyy</a></td><td>Text text text text text text
text</td></tr>
</table>

--
Nico
http://www.nicoschuyt.nl


 
Reply With Quote
 
Nico Schuyt
Guest
Posts: n/a
 
      03-19-2005
Nico Schuyt wrote:
> Clemenza wrote:
>> I have a table for my menu. This table contains menu items as text.
>> Each td tag contains a separate menu text.
>> How is it possible (without javascript and making text as image) to
>> make the whole td cell as link and not only the text?
>> I tried to put the td cell inside the a tag, but it is not a valid
>> html sollution.
>> Any idea?

>
> Something like:
> a{display:block;width:100%;height:100%;}
> a:hover{background:yellow;}


But, like Steve already mentioned, a table probably is not necessary for the
menu

--
Nico
http://www.nicoschuyt.nl


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show a link target in a table cell a HTML 6 07-28-2005 05:00 AM
empty table cell to be used as link Greg N. Javascript 5 04-04-2005 04:19 PM
add hyber link to table or table cell web control Symphony ASP .Net Web Controls 1 03-16-2005 12:30 AM
Table in a cell of another table Mark Goldin ASP .Net 2 08-19-2004 10:42 AM
How do I have a table cell fetch another page to display within the cell? Phillip Roncoroni HTML 14 04-05-2004 05:58 PM



Advertisments