How to get cells () x and y coordinate in table using jQuery?

后端 未结 2 491
日久生厌
日久生厌 2020-12-28 18:10

I\'m looking for a good way to get cells X-Y position in a table. (do not confuse it with css-position, I am looking for X and Y coordinate in Cartesian coordinate system).<

2条回答
  •  梦毁少年i
    2020-12-28 18:48

    DOM Level 2 HTML cellIndex:

    alert('My position in table is: '+this.cellIndex+'x'+this.parentNode.rowIndex);
    

提交回复
热议问题