PHP - how do i make a cell to be a link - Asked By Olusegun A. on 11-May-10 08:01 PM

Hello friends,

I want to make some of my cell to be links eg
table width="200" height="128" border="0" cellpadding="5" cellspacing="0">
<tr>
<td>Home</td>
</tr>
<tr>
<td>Abour Us </td>
</tr>
<tr>
<td>Contact</td>
</tr>
</table>

so that instead of making only the words on the cell to be links (<a href="mysite.com/aboutus.html">About Us</a>) i want it to be that once you click anywhere on the About Us cell, you should be directed to about us page.

regards

Try putting the word in a DIV tag - Robbe Morris replied to Olusegun A. on 11-May-10 08:30 PM

and wire up the onclick eventof the DIV.  EggHeadCafe does this with the pagination links on
http://www.eggheadcafe.com/forumtree.aspx

We set the display:block on the div with the class "pages".  In this case it applied that
aspect to every anchor tag in the div.

.pages


a, .pages span {

color:#3681cc;

display: block;

float: left;

padding: 0.2em 0.5em;

margin-right: 0.1em;

border: 1px solid #fff;

background: #fff;

height: 11px;

}

Arun Kumar Ramesh replied to Olusegun A. on 12-May-10 12:27 AM
Hi,

Here is the code how to make the entire cell a link.

<td colspan="9" valign="top" bgcolor="#CCCCCC" align="center" onClick="document.location.href='mysite.com/aboutus.html';" style="cursor:pointer;cursor:hand"><strong>About Us<br>
</strong><br>
(more info)</td>


This will make the entire cell look like a link. So if you click any where on the link you will be redirected to the respective url.

Regards,
Arun ramesh