You can add event listener to the table use e.target.cellIndex to get column index use e.target.parentNode.rowIndex to get row index