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">
<td>Abour Us </td>

so that instead of making only the words on the cell to be links (<a href="">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.


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

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.


a, .pages span {


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

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='';" style="cursor:pointer;cursor:hand"><strong>About Us<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.

Arun ramesh