Forum Moderators: not2easy

Message Too Old, No Replies

Position absolute problems with tables.

problems with position absolute on table and a div inside table

         

jbrao

12:51 am on Feb 24, 2004 (gmt 0)



I have to show a menu dynamically at the mouse click position.
It shows the menu at the mouse click position if I do not have any styles with absolute or relative positions on the enclosing table tag. But when I add them to the table the menu is getting displaced by the position values on the table.

How to get around this problem?
Thanks in advance for your valuable time spent on this.

The code snippet:

<table style="position: absolute; left: 0px; top: 100px;">
<tr>
<td>This is the first line</td>
</tr>
<tr>
<td>To see the menu<a href="#" onclick="document.all.dynmenu.style.visibility='visible';document.all.dynmenu.style.top=event.clientY;document.all.dynmenu.style.left=event.clientX;">Click here</p>
<div id="dynmenu" style="visibility:hidden;position:absolute;top:0px; left:0px">Menu</div></td>
</tr>
</table>

Remove the style on the table to see the position of the menu.

knighty

9:14 am on Feb 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dont use layers within tables