Solved

Finding the xy of a table cell

Posted on 2001-09-17
6
214 Views
Last Modified: 2010-04-09
How can I find the X,Y coord of a table cell?
I want this so I can place a layer underneath the cell.
0
Comment
Question by:calvinrsmith
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6488231
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
 
LVL 1

Author Comment

by:calvinrsmith
ID: 6488261
nope doing this:
<div id=me style="position:relative;">

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

returns an empty alert box
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6488290
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 40 total points
ID: 6694895
Not a pretty workaround, but as close as it gets, so that is the answer.

Cd&
0
 
LVL 1

Expert Comment

by:Computer101
ID: 6716519
Comment from COBOLdinosaur accepted as answer.

Thank you
Computer101
Coommunity Support Moderator
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6717652
Thanks C101 :^)

Cd&
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
removing a class in javascript 4 70
Popup write two lines 3 22
Making Table Thru ASP Response.write 5 19
HTML or/and CSS codes to construct numbered paragraphs. 5 19
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question