Thanks very much mkmanning -- I realise now that the scope of eq is the whole doc and nth-child is all n-th children of the parent. Sigh, one day I will see this stuff more quickly myself -- meantime, thanks again ^_^
-Alan On Mar 2, 11:01 pm, mkmanning <michaell...@gmail.com> wrote: > $('.vfOptions tr td:nth-child(3)').addClass('status'); > > On Mar 2, 7:15 pm, alanfluff <alan.c.bris...@googlemail.com> wrote: > > > Hi, > > > I am embarrassed to say I can't find a way to select the third cell in > > each row of a table and add a class to it. > > > I tried this: > > > $('.vfOptions tr td').eq(2).addClass('status'); > > > and it worked for the first row but not subsequent rows. > > > So I tried this, thinking it was the correct construct perhaps > > > $('.vfOptions tr td').(function() { > > $(this).eq(2).addClass('status'); > > }); > > > but it failed to add class to any rows at all. > > > I would be MOST grateful for any clues as to what I am doing wrong - > > thanks in advance in deed! > > > Cheers, -Alan