File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes striped table in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "striped table in JSP" Watch "striped table in JSP" New topic
Author

striped table in JSP

Eduardo Ponce de Leon
Ranch Hand

Joined: May 13, 2009
Posts: 99
I am displaying code from a DB. What I want to do is to give it some format to my table. By format i mean html color so that each odd rows have a gray background and even rows have a white background, like a striped table. how can i create that dinamic table?

This is what i have for my code...like i said i can display my table with no problem.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

Just like any other HTML page, with CSS.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Here's how I do it in EL; the 'grey' and 'white' constants refer to entries in the page's CSS.

Eduardo Ponce de Leon
Ranch Hand

Joined: May 13, 2009
Posts: 99
never used CSS... where do does tags go in my code? Sorry, I am a beginner
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

As JSP creates HTML pages, you need to bring yourself put to date with HTML, CSS and JavaScript.
Eduardo Ponce de Leon
Ranch Hand

Joined: May 13, 2009
Posts: 99
Really, I´ve been reading and cannot figure it out... I am sure it is not that hard but can somebody teach me how to do it?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

My google keywords were "css tutorial" (it's been a while since I learned how to do this). Here's a representative link: starting with HTML + CSS.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

If you are a novice to JSP, I highly recommend this article.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: striped table in JSP