$("#summaryTable tbody tr td").click(function(){
var col = ($(this).index());
if(col == 2 || col == 1)
{
alert("do nothing");
}
alert("do something");
}
});
This will happen when the first column is clicked, but not the second or third.
Tables are very similar to arrays, 0 is the first, so if we had 3 columns in the table, you would have a column of 0,1,2.
You can add more values to the if statement
Hope this helps
James source
share