This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
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
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply 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: 56529
    
  14

Did you forget to post your code?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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 ?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to set the number of values per column
 
Similar Threads
Nested Loops
Arrays with files
how to return resultset from server to client in rmi
urgent urgent .....How do i do paging in JSP ?????
Struts2 Checkbox: How to set value back to Bean