Ah, one problem Karl. Thanks again for your help though there's just
one thing that I don't really understand.

I was attempting to use such a selector in a site-wide $
(document).ready() context. Hence this applies to all tables which is
problematic.

Hence initially I was attempting the equivalent (using your example)
of:

$('.relevantTableClass td:nth-child(2)').css('textAlign', 'center');

and I've tried this again just now but it fails.

Should a similar syntax be possible?

The following works:

$('#relevantTableId td:nth-child(2)').css('textAlign', 'center');

however a class-based solution would work better for me. Is this
possible?

Thanks
pd

On May 8, 11:20 am, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> If I understand your situation correctly, you might be looking
> for :nth-child()
>
> You could, for example, get the 2nd cell of each row this way:
> $('td:nth-child(2)').css('textAlign', 'center');
>
> Remember that nth-child() is the only jQuery selector that is 1-
> based, because it's based solely on the CSS spec.
>
> Cheers,
>
> --Karl
> _________________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On May 7, 2007, at 9:10 PM, pd wrote:
>
>
>
> > Hello
>
> > I've looked up
>
> >http://docs.jquery.com/Selectors
>
> > and alas I can't determine if there is a way to select the x td of all
> > rows of a table.
>
> > The use case is that i have a table for a forum and I'd like to center
> > text-align the 'Topics' and 'Replies' totals columns.
>
> > Thanks
> > pd

Reply via email to