Meaningless Drivel is fun!
The moose likes HTML, CSS and JavaScript and the fly likes Finding Table Cell co-ordination Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Finding Table Cell co-ordination" Watch "Finding Table Cell co-ordination" New topic

Finding Table Cell co-ordination

Tokai Moshai

Joined: May 24, 2006
Posts: 16
Say I have a table with 3 rows and 3 columns (to keep it simple, in real case it is going to be dynamic). Each of the cell has a hyperlink that calls a function. What need to know is, is there any way to know which cell was clicked using some javascript function?

If I'm not clear,

say I have

<td><a href="javascript:myFunc()"</a></td>

what I need is something like
<td><a href="javascript:myFunc(TableXcoord,TableYcoord)"</a></td>

I'm not able to put those TableXcoord, TableYcoord values when creating the table. so, is there anything like rows[mouse_click].cells[mouse_click]?

Or is there any other way I can solve this problem? I'm not able to put the row values the table that is being created by a class that creates all the cells of the column at the same time. I can put the column values.

Please let me know if I'm still not clear.
Tokai Moshai

Joined: May 24, 2006
Posts: 16
I found it:

use OnClick with window.event.srcElement.recordNumber
I agree. Here's the link:
subject: Finding Table Cell co-ordination
It's not a secret anymore!