views:

137

answers:

1

How can i add a link to my td tag from a table? onclick doesnt work for me :S, or maybe a good example :P

my td tag:

$world .= ('<td background="images/world/Heli.jpg" border="1"></td>');

link:

<a href="?site=world&action=showvillage&id=' . getVillageID(($xm2), ($ym2)) . '"></a>

thnx :D

A: 

If you want the link to behave such that the entire (cell) is clickable and navigates to the link, you could wrap it in an (anchor) tag like this:

<a href="?site=world&action=showvillage&id=' . getVillageID(($xm2), ($ym2)) . '">
    <td background="images/world/Heli.jpg" border="1">&nbsp;</td>
</a>

I don't know how your $world variable is being used, so you'll have to arrive at the above formatting on your own.

JYelton