Two Laptop Bag*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60810
    
  65

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: 18541
    
    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: 60810
    
  65

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: 18541
    
    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: 60810
    
  65

If you are a novice to JSP, I highly recommend this article.
 
Consider Paul's rocket mass heater.
 
subject: striped table in JSP
 
Similar Threads
HTML Table "Stripes" with CSS
JSP form with four inputs and one submit button
Make rows not appear when certain row value appears
How to Export web page(jsp page) to excel using jsp or servlets
Extra rows when displaying resultSet in browser