Entry: Highlight and Hyperlink entire table Saturday, November 24, 2012

I try several method on this. Some work on ie but unfortunately it doesn't work on firefox/chrome. After a few try and error, I managed to get the right coding on doing it. What I did is :-

I use <a href....> and add onclick function to open new window. This code work on ie but not in firefox or chrome

<a href=# onclick="window.open('new_link.php?act=search&id=<?=$id?>','blank','menubar=1,resizable=1,width=800,height=400,scrollbars=1,location=1,resizable=no')" >
<tr bgcolor="#fff5ed" onMouseOver="this.bgColor = '#FFFFFF'" onMouseOut ="this.bgColor = '#fff5ed'" style="cursor:pointer">
<td>Try and error</td>


I made some adjustment and found this one. Instead of adding onclick on <a href..>, I add this onclick on <tr> and call function to open new window.

After :

<tr bgcolor="#fff5ed" onMouseOver="this.bgColor = '#FFFFFF'" onMouseOut ="this.bgColor = '#fff5ed'" style="cursor:pointer" onclick="get_link(<?=$id?:>);">
<td>Try and error</td>

function get_link(id)


p/s : for <bgcolor="#fff5ed" onMouseOver="this.bgColor = '#FFFFFF'" onMouseOut ="this.bgColor = '#fff5ed'" style="cursor:pointer" > this to add hand pointer and hightlight the entire table and it work on all browsers.



Leave a Comment:


Homepage (optional)