[jQuery] Re: Zebra striping in tables

2008-02-05 Thread Snef
ilto:[EMAIL PROTECTED] On Behalf Of RobG > Sent: Tuesday, February 05, 2008 5:06 AM > To: jQuery (English) > Subject: [jQuery] Re: Zebra striping in tables > > > > > > On Feb 5, 7:57�pm, Snef <[EMAIL PROTECTED]> wrote: > > Karl, > > > > Again, many than

[jQuery] Re: Zebra striping in tables

2008-02-05 Thread Karl Swedberg
ginal Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of RobG Sent: Tuesday, February 05, 2008 5:06 AM To: jQuery (English) Subject: [jQuery] Re: Zebra striping in tables On Feb 5, 7:57 pm, Snef <[EMAIL PROTECTED]> wrote: Karl, Again, many thanks. On

[jQuery] Re: Zebra striping in tables

2008-02-05 Thread Smith, Allex
nd it will not be part of your structure. Allex -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of RobG Sent: Tuesday, February 05, 2008 5:06 AM To: jQuery (English) Subject: [jQuery] Re: Zebra striping in tables On Feb 5, 7:57 pm, Snef &l

[jQuery] Re: Zebra striping in tables

2008-02-05 Thread RobG
On Feb 5, 7:57 pm, Snef <[EMAIL PROTECTED]> wrote: > Karl, > > Again, many thanks. Only just one question... > > I have used your one-liner like this: > > $("table tr:nth-child(even)").css("background", "#cc"); > > I played around with the :not(:first) to eliminate the first row of > each ta

[jQuery] Re: Zebra striping in tables

2008-02-05 Thread Snef
Karl, Thank you! This is what I was looking for! Karl Swedberg schreef: > One way to solve your dilemma is to use tr:nth-child(even). That will > select all table rows that are an "even" child of their parent > element. This should work: > > $("table tr:nth-child(even)").css("background", "#

[jQuery] Re: Zebra striping in tables

2008-02-05 Thread Snef
Karl, Again, many thanks. Only just one question... I have used your one-liner like this: $("table tr:nth-child(even)").css("background", "#cc"); I played around with the :not(:first) to eliminate the first row of each table but i do not get it working. Is this possible to use this, or is

[jQuery] Re: Zebra striping in tables

2008-02-05 Thread Snef
Allex, This is what I was thinking of but couldn't get my hands on the 'find'. Your solutions works, but I think I go for Karls solution (a one- liner). Thank you! Smith, Allex schreef: > Couldn't you just use $(this) and then do whatever selector? > > $("table").each(function() { > $(thi

[jQuery] Re: Zebra striping in tables

2008-02-04 Thread Karl Swedberg
One way to solve your dilemma is to use tr:nth-child(even). That will select all table rows that are an "even" child of their parent element. This should work: $("table tr:nth-child(even)").css("background", "#cc"); --Karl _ Karl Swedberg www.englishrules.com www.learn

[jQuery] Re: Zebra striping in tables

2008-02-04 Thread Smith, Allex
Couldn't you just use $(this) and then do whatever selector? $("table").each(function() { $(this).find('tr:even').css("background-color", "#ff"); }); Maybe I don't understand the question. Allex -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] O