Take a look at this:
$(document).ready(function(){
$('.TreeTable tr').click(function(e){
var cell = $(e.target).get(0);
var tr = $(this);
$('#out').empty();
$('td', tr).each(function(i, td){
$('#out').html(
$('#out').html()
+'<br>'
+i+': '+$(td).text()
+ (td===cell?' [clicked]':'') );
});
});
});
Here is the working code: http://jsfiddle.net/VbA9D/
If you have other HTML elements inside the table cells that you could click on, the example below will work better:
$(document).ready(function(){
$('.TreeTable tr').click(function(e){
var cell = $(e.target).get(0);
if(cell.nodeName != 'TD')
cell = $(cell).closest('td').get(0);
var tr = $(this);
$('#out').empty();
$('td', tr).each(function(i, td){
$('#out').html(
$('#out').html()
+'<br>'
+i+': '+$(td).text()
+ (td===cell?' [clicked]':'') );
});
});
});
, :
http://jsfiddle.net/7PWu5/