> I have a link which sits inside a td within a tr within a table.  What
> I would like to do is find out which td (which column) in the table
> this link is within - I need to find the column index.
>
> Once I have this I can then remove the column from the table.
>
> Any ideas on how to do this?  I've tried the core index - but to no
> avail.


"index" is the way to go, you just need to be clever.  Try something
like this:

$('a.removeColumn').click(function() {
        var $td = $(this).parents('td:first');
        var $tr = $td.parents('tr:first');
        var index = $tr.children().index($td);
        // ...
});

Reply via email to