[jQuery] Re: find table column's (td's) header (th) ?

2008-04-09 Thread R. Rajesh Jeba Anbiah
On Apr 8, 10:00 am, Hamish Campbell [EMAIL PROTECTED] wrote: Here is one way - it will find the header (th) for any cell (td) given that there are no merged cells and a single header row. $('td').click(function(){ var col = $(this).prevAll().length; var headerObj =

[jQuery] Re: find table column's (td's) header (th) ?

2008-04-08 Thread Hamish Campbell
Here is one way - it will find the header (th) for any cell (td) given that there are no merged cells and a single header row. $('td').click(function(){ var col = $(this).prevAll().length; var headerObj = $(this).parents('table').find('th').eq(col); // A quick test! alert(My cell

[jQuery] Re: find table column's (td's) header (th) ?

2008-04-07 Thread RobG
On Apr 8, 1:56 pm, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: I'm just wondering if there is any easy way to find out the header (th) of the table column (td)? Say, -- | head1 | head2 | -- | r11 | r12 | -- | r21

[jQuery] Re: find table column's (td's) header (th) ?

2008-04-07 Thread R. Rajesh Jeba Anbiah
On Apr 8, 9:56 am, RobG [EMAIL PROTECTED] wrote: On Apr 8, 1:56 pm, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: I'm just wondering if there is any easy way to find out the header (th) of the table column (td)? Say, -- | head1 | head2 | --