View Full Version : How to make entire cell to act as a link

02-07-2012, 07:19 PM
Hi there,

I've a problem and want to get it fixed. I've designed a website with it's navigation pane on the left. This website is designed using tables, all the links displaying in cells, now I want to make the entire cell to act as a link. Below is the code:

<td width='167' height='23' valign='middle' onMouseOver="this.bgColor='#4A4A4A'" onMouseOut="this.bgColor='#333331'" bgColor='#333331'>
<p class='PaneText'><a class='PaneLink' href='policies.php?pg=1'>Sampling Policy</a></p>

In the above code the cell color changes on mouse over to act as the active link, I want the entire active cell/option to act as a link.

Please help me with your expertise. Thanks!

02-07-2012, 07:36 PM
I'm basically a DBA coder since 1999, switched to server-side DBAs and not well-versed in CSS even in DIVs :( that's why I still use tables for layout my designs.

Well, it sounds somehow strange & I've never tried it as well but the first thing that comes in my mind is to wrap my <td></td> around <a href='somewhere'></a> tags. Don't know whether it works or not and will this be a good practice if it does???

One more little thing I want is that when a user moves mouse over the cell, its color should change to something else and the color / style of text inside the cell (that has a link) should also be changed. Any suggestion???