View Full Version : Tracing Cells and Editing contents

u jayakodi
10-16-2012, 02:26 PM
This tiny utilty displays the cell row and column numbers when the mouse is moved over it; click on a cell to edit its contents. No problem with multiple tables in a page.

Just add the two script blocks to the page containing tables; the program uses the TITLE property to display the address. No code is needed for the cells nor the cumbersome routine to detect a table or cell; the event for the document is made to respond at a lower order TD tag of the cell and its relation to the parent row completes the task.


<script for=document event=onmouseover>
var ele=event.srcElement;if(ele.tagName=="TD"){ele.title="Row = "+ele.parentNode.rowIndex.toString()+"; Col = "+ele.cellIndex.toString()}
<script for=document event=onclick>
var ele=event.srcElement;if(ele.tagName=="TD"){rn=ele.parentNode.rowIndex;cn=ele.cellIndex

A test page with two tables test.htm is in the zip file.