<table border="1">
<tr id="row">
<td width="20" height="20"></td>
<td width="20" height="20"></td>
</tr>
</table>
<script>
function myPosition() {
alert("Координаты X: " + this.cellIndex);
alert("Координаты Y: " + this.parentNode.rowIndex);
}
[].forEach.call(row.querySelectorAll('td'),node=>node.onclick=myPosition);
</script>