Do these cells contain *only* the nbsp? If so, you could go at it another way:

$('td:last-child').each(function()
{
        if ('' == $(this).text().trim())
        {
                $(this).parent().addClass('markeme-sub');
        }
});


On Fri, Jan 8, 2010 at 7:41 AM, Jonatan <jona...@kig.se> wrote:
> Hi,
>
> I've just recently started to use jQuery, and it has already proven
> extremely useful for formatting tables (and other things as well!). I
> get raw html-tables into my page, and my only way of styling them are
> css and, now, jquery. And it's worked out fine.
>
> But now I've run into a problem. Which seems to depend on which
> browser you use.
>
> I'm trying to give the table rows with the last cell containing
> "&nbsp;", a specific style by adding a class. In FF/Safari/Chrome it
> behaves as I expect it. But Internet Explorer gives me no result at
> all.
>
> The code:
> $("tr td:last-child:contains('\u00a0')").parent().attr
> ('class','markeme-sub');
>
> And I'm stumped. Is it because of how browsers handle the whitespace,
> or am I missing something in my jquery?
>
> Thankful for any help!
>
> Best regards
> Jonatan
>

Reply via email to