File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes jQuery doubt with reference to  Object Literal Example. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jQuery doubt with reference to  Object Literal Example." Watch "jQuery doubt with reference to  Object Literal Example." New topic
Author

jQuery doubt with reference to Object Literal Example.

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

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




http://www.lifesbizzare.blogspot.com || OCJP:81%
Amit Bhargava
Greenhorn

Joined: May 20, 2011
Posts: 20
Could you please post the JSP/HTML page where this is going to be applied?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Aug 01, 2009
Posts: 1055

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

Joined: Nov 08, 2001
Posts: 15376
    
    6
See fine to me: http://jsfiddle.net/H9wHT/1/

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Why do you have headings in a td?

Your table really should look like this:

Amit Bhargava
Greenhorn

Joined: May 20, 2011
Posts: 20
I haven't tried this out myself, but have you tried $('table.data tr:even')?
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

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

Joined: Jan 10, 2002
Posts: 61221
    
  66

Do your td elements have a background color? If so, the color of the tr element will not show through.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jQuery doubt with reference to Object Literal Example.