开发者

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">&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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜