php/html add link to table <TD>
How can I add a link to my td
tag from a table
?
onClick
doesn't work. I could use a good example.
My td
tag:
$world .= ('<td background="images/world/Heli.jpg" border="1"></td>');
开发者_开发问答A link:
<a href="?site=world&action=showvillage&id=' . getVillageID(($xm2), ($ym2)) . '"></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"> </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.
精彩评论