Guy,

Ahhhh - I understand.

I think you can make your code a bit simpler and not use the .each
(function(). It depends on rest of the HTML whether it works or not.
Something like this:

$('tr.myclass').parents('table').parents('table').css("border", "4px
black solid");

Rgds Paul

On Dec 11, 9:04 pm, Guy <g...@epicsky.com> wrote:
> OK,
>
> Figured it out and am posting this for anyone who may have this
> question later on.
>
> Here's what I used:
>
> $("tr.myClass").each(function() {
>   $(this).parents("table").slice(1,2).css("border", "4px black
> solid");
>
> });
>
> Hope that is helpful to others.
>
> Guy
>
> On Dec 11, 12:13 pm, Guy <g...@epicsky.com> wrote:
>
> > Hi,
>
> > I'm having a dilemma where I need to style the table which encloses a
> > table with a row which has a style attached to it.
>
> > The source looks like this.
>
> > <table>
> > <tbody>
> > <tr>
> > <td>
> > <table>
> > <tbody>
> > <tr class="myClass">
> > etc.
>
> > I want to be able to directly access the first table tag to style the
> > entire table with a border. Is there an easy way to do this in jQuery?
>
> > Thanks,
>
> > Guy Davis

Reply via email to