Требует доработки, использовать не рекомендуется
<style>
td {
border: solid 1px;
width: 200px;
cursor: pointer;
}
table {
border: solid 1px;
}
</style>
<table id="table">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</table>
<script>
window.onload =function () {
var table = document.getElementById('table');
table.onclick = function (e) {
e = e || event;
var target = e.target || e.srcElement;
if (target.parentNode.tagName == 'TR') {
alert(target.innerHTML);
} else if (target.tagName == 'TABLE') {
var x = e.clientX;
var y = e.clientY;
while (target.parentNode.tagName != 'TR') {
x++;
y++;
target = document.elementFromPoint(x, y);
if (target.parentNode.tagName == 'TR') {
alert(target.innerHTML);
break;
} else if (target.tagName != 'TABLE') {
alert('ha');
break;
}
}
}
}
}
</script>