Here's the basic HTML:
<table cellspacing="0" class="product-table">
<tr>
<td></td>
<td>{Thumbnail}</td>
<td>
<table cellspacing="0">
<tr>
<td colspan="2">{Product Name}</td>
</tr>
<tr>
<td>Product Sku:</td>
<td>{Sku}</td>
</tr>
<tr>
<td>Size / Color:</td>
<td>{Attr}</td>
</tr>
<tr>
<td colspan="2">In Stock!</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="0" class="product-table">
<tr>
<td></td>
<td>{Thumbnail}</td>
<td>
<table cellspacing="0">
<tr>
<td colspan="2">{Product Name}</td>
</tr>
<tr>
<td>Product Sku:</td>
<td>{Sku}</td>
</tr>
<tr>
<td>Size / Color:</td>
<td>{Attr}</td>
</tr>
<tr>
<td colspan="2">In Stock!</td>
</tr>
</table>
</td>
</tr>
</table>
the :first-child matches the child table as well, which won't work for
me. Is there a way to exclude nested tables?
-Brandon
On Aug 24, 8:19 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi Brandon,
>
> the + combinator is for the next sibling element. since td is never a
> sibling of tr, your selector isn't going to work there.
>
> To get the first td in each tr, use the :first-child pseudo-class
> :
> jQuery('#rank-products table.product-table td:first-child').addClass
> ('rank-handle');
>
> Hope that helps
>
> --Karl
> _________________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Aug 24, 2007, at 8:29 PM, Benjamin Sterling wrote:
>
> > Can we see the table you are working with? Also, try putting tbody
> > tr td:first..
>
> > On 8/24/07, Brandon < [EMAIL PROTECTED]> wrote:
>
> > I am trying to target the first table cell in each table row. I'm not
> > familiar with the + character, but I thought it might be the key, but
> > it wasn't:
> > jQuery('#rank-products table.product-table tr + td').addClass('rank-
> > handle');
>
> > And of course this doesn't work either.
> > jQuery('#rank-products table.product-table tr td:first-
> > child').addClass('rank-handle');
>
> > Also, it's important that this doesn't target nested tables (eg.
> > #rank-
> > products table.product-table table).
>
> > Is this possible without getting too complex?
>
> > --
> > Benjamin Sterling
> >http://www.KenzoMedia.com
> >http://www.KenzoHosting.com