Finding the xy of a table cell

How can I find the X,Y coord of a table cell?
I want this so I can place a layer underneath the cell.
LVL 1
calvinrsmithAsked:
Who is Participating?
 
COBOLdinosaurConnect With a Mentor Commented:
Not a pretty workaround, but as close as it gets, so that is the answer.

Cd&
0
 
COBOLdinosaurCommented:
As table cells are not directly positionable, they do not have a top
and left attribute.  You could put another element like a div in there
and style it with relative positioning.  that should then let you tet
the left and top attribute of the styles.

Cd&
0
 
calvinrsmithAuthor Commented:
nope doing this:
<div id=me style="position:relative;">

and this:
alert(me.style.left);

returns an empty alert box
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
COBOLdinosaurCommented:
Now that I think of it, what I suggest can't work because it would
not be able to knows its postion because there is no positioning for
the cell which is its parent.  

I think the only possibility you have is to get the position of
table and calculate the position of the cell as an offset, but
the size of cells can be variable based on local settings, so it
does not look like it will be straight forward.

Cd&
0
 
Computer101Commented:
Comment from COBOLdinosaur accepted as answer.

Thank you
Computer101
Coommunity Support Moderator
0
 
COBOLdinosaurCommented:
Thanks C101 :^)

Cd&
0
All Courses

From novice to tech pro — start learning today.