Two Laptop Bag*
The moose likes JSP and the fly likes How to set the number of values per column 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 "How to set the number of values per column" Watch "How to set the number of values per column" New topic
Author

How to set the number of values per column

Mahesh Lohi
Ranch Hand

Joined: Jun 22, 2009
Posts: 150
Hi all,

I wish to display 5 records per row. the 6th record must start from the 2nd row. Please help.
ex:
3 4 5 6 7
3 4 2 3 5
.
.
so on

Each record is retrived from DB.

Thank you in advance


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60783
    
  65

Did you forget to post your code?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Bear Bibeault wrote:Did you forget to post your code?


Is that a serious question or are you nicely asking to come up with an approach first? ;)


JDBCSupport - An easy to use, light-weight JDBC framework -
Mahesh Lohi
Ranch Hand

Joined: Jun 22, 2009
Posts: 150
Sebastian Janisch wrote:
Bear Bibeault wrote:Did you forget to post your code?


Is that a serious question or are you nicely asking to come up with an approach first? ;)


Thank you for the quick reply

I have few records int the DB I would like only 5 reconds in each row. Onces executeQuery statement is executed the result will be in rs. Now the problem is how can I limit the recordes in each row to 5 in jsps

Thank you in advance
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Think about it. What you need is a loop. Starting a new line means that whenever the run variable divided by 5 has no rest, there needs to be a new row.

Try yo come up with some code of your own. The hint above should help you...
Mahesh Lohi
Ranch Hand

Joined: Jun 22, 2009
Posts: 150
Sebastian Janisch wrote:Think about it. What you need is a loop. Starting a new line means that whenever the run variable divided by 5 has no rest, there needs to be a new row.

Try yo come up with some code of your own. The hint above should help you...


Thank you for your post

Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Mahi Lohi wrote:

Thank you for your post



Could you post your code so others can profit from it ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to set the number of values per column
 
Similar Threads
Nested Loops
how to return resultset from server to client in rmi
Struts2 Checkbox: How to set value back to Bean
urgent urgent .....How do i do paging in JSP ?????
Arrays with files