Building on Karl's example and your new all-td's-must-be-empty requirement; mark all the TR's with a target class then sweep through the TD's and get rid of the target class if you find a td that is not empty. Play around a bit and see what else you can come up with.
Ian ---- $(document).ready(function() { $('tr').addClass('allEmptyTds'); // mark $('td').each(function() { var $this = $(this); if ($this.html() !== ' ') { $this.parent().removeClass('allEmptyTds'); // and sweep } }); }); On 4/27/07, Feed <[EMAIL PROTECTED]> wrote:
Feed wrote: > Hello all, I'm getting used to the excellent jQuery library and I need > some help of more experienced programmers. I have this simple table: > > <table class="table"> > <tr> > <td>content</td> > <td>content</td> > <td>content</td> > </tr> > <tr> > <td> </td> > <td> </td> > <td> </td> > </tr> > <tr> > <td>content</td> > <td>content</td> > <td>content</td> > </tr> > </table> > > What I need is to add a class to the TRs that have children TDs that > have inside (and ONLY )... I'm having problems because > &nbps; is not text, it's html code... > > Thanks in advance! Thanks guys, that really helped, specially Karl Swedberg's piece of code. The problem is: the class must only be applied to the TR only if ALL children TDs have inside... I'm having a hard time making it work, I'm still learning how to use jQuery properly.