views:

36

answers:

1

here is code:

<script type="text/javascript">
     function doit(){
         $('table td').each(function () {
         if ($(this).text().trim() != '')
             $(this).css("border", "1px groove white");
         });
     }
     doit();
</script>

this works in chrome and firefox. BUT in IE 6 and 8 i have 'Object doesn't support this property or method'

+3  A: 

The issue isn't with .css(), but with .trim(). IE doesn't have a native .trim() method for String.

You can use jQuery's $.trim() instead.

$.trim($(this).text())

So the if() statement would be:

if ( $.trim($(this).text()) != '' )
    $(this).css("border", "1px groove white");
patrick dw
omg. 2 hours wasted. thanks!!!!!
eba
@eba - You're welcome. :o)
patrick dw