Hi,

try this:
$('tr:not(:has(th)):even')
...

...or consider using <thead> and <tbody> elements in your markup to separate
table-header from the data rows :)

--
Bohdan


matifibrahim wrote:
> 
> 
> 
> //
> $(document).ready(function() {
> $('th').parent().addClass('table-heading');
> $('tr:not([th]):even').addClass('even');
> $('tr:not([th]):odd').addClass('odd');
> $('td:contains("Henry")').addClass('highlight');
> });
> //
> 
> It is supposed to add 'even' and 'odd' classes to odd and even number
> of rows of a table EXCEPT TABLE HEADER, but unfortunaley it is not
> working as it should because it also formates the heading (attaching
> 'even' class to table header and I can see it in firebug). It looks
> that the filter '[th]' is not working. Tested both on FF and IE, same
> problem on both. Is it something wrong with [th]? Any recommendation?
> One more thing, I also tried it with 'jquery-1.2.2.js', but the same
> problem. Thanks in advance..
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-in----filter-tp15137666s27240p15140218.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to