Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jQuery doubt with reference to Object Literal Example.

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The below code is not working....I mean i wanted even table rows to be gray but its not happening ??? I am not sure where I am wrong in this case


 
Amit Bhargava
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please post the JSP/HTML page where this is going to be applied?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It has nothing to do with the object, it hsa to do with the example.

Background color is applied to the cells [td] and not the rows [tr].

Eric
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric Pascarello wrote:It has nothing to do with the object, it hsa to do with the example.

Background color is applied to the cells [td] and not the rows [tr].

Eric



But the below code is working fine... and its the same example

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See fine to me: http://jsfiddle.net/H9wHT/1/

Eric
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you have headings in a td?

Your table really should look like this:

 
Amit Bhargava
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't tried this out myself, but have you tried $('table.data tr:even')?
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric Pascarello wrote:Why do you have headings in a td?

Your table really should look like this:



Will that make any changes?? I mean .js file should work right incase i am using Object Literal??? it is working when i am using .css(mentioning the color code)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do your td elements have a background color? If so, the color of the tr element will not show through.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic