[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread [EMAIL PROTECTED]
I've tried the method Mehmet but still no success with this goal (select every first TD on every TR. Maybe im doing something wrong, but can someone assure if this code is in fact correct? Regards! On Jun 10, 10:40 am, Mehmet AVSAR [EMAIL PROTECTED] wrote: $(tr).each(function() { $(TD,

[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread spinnach
what about: $('tr').each(function(){ $('td:first', this).addClass('tomas'); }); dennis. [EMAIL PROTECTED] wrote: I've tried the method Mehmet but still no success with this goal (select every first TD on every TR. Maybe im doing something wrong, but can someone assure if this code is in

[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread John Resig
The solution is what Klaus posted - you just have to use :first-child. $(td:first-child).addClass(tomas); --John On 6/8/07, jorgeBadaBing [EMAIL PROTECTED] wrote: I have been looking online at the documentation and don't seen to have any luck find a way of doing this. So far I can do this:

[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread John Resig
Err, I meant Karl - sorry! On 6/30/07, John Resig [EMAIL PROTECTED] wrote: The solution is what Klaus posted - you just have to use :first-child. $(td:first-child).addClass(tomas); --John On 6/8/07, jorgeBadaBing [EMAIL PROTECTED] wrote: I have been looking online at the documentation and

[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread Ganeshji Marwaha
one more solution - $(tr).find(td:eq(0)).addClass(someClass); On 6/30/07, John Resig [EMAIL PROTECTED] wrote: Err, I meant Karl - sorry! On 6/30/07, John Resig [EMAIL PROTECTED] wrote: The solution is what Klaus posted - you just have to use :first-child.

[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread Karl Swedberg
Hey John, No need to apologize to me. I take it as a compliment! :-) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jun 30, 2007, at 1:41 PM, John Resig wrote: Err, I meant Karl - sorry! On 6/30/07, John Resig [EMAIL PROTECTED] wrote: The solution

[jQuery] Re: Selecting the first TD of every Row

2007-06-10 Thread Mehmet AVSAR
$(tr).each(function() { $(TD, $(this)).get(0).addClass(tomas) }); On Jun 8, 6:40 pm, Karl Swedberg [EMAIL PROTECTED] wrote: $('tr td').addClass(tomas); actually, that will select all td elements that are children of a tr element -- in other words, all td elements. Try this instead:

[jQuery] Re: Selecting the first TD of every Row

2007-06-08 Thread Karl Swedberg
$('tr td').addClass(tomas); actually, that will select all td elements that are children of a tr element -- in other words, all td elements. Try this instead: $('td:first-child').addClass('tomas'); That selects all td elements that are the first child of their parent element. This