aspose file tools*
The moose likes JSP and the fly likes EL algorithm help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "EL algorithm help" Watch "EL algorithm help" New topic
Author

EL algorithm help

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi guys, I need to forumulate my algorithm right... I can't seem to think of a better one and the layout of my page gets crazy. I have to do things as follows...


1. Iterate through a list
2. For every record in the list, display information.
3. Only 4 records per row...

I would be easy if I only had to display the records downward.. But I have to make another table row after every 4th record... My tables keep on getting scrammbled, so maybe... If you guys could help... Thank you!


Here's how I do the iteration...



[ June 19, 2006: Message edited by: Bear Bibeault ]

SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
If you look at the html generated, it'll give you a big clue. I'm estamating based on a read through that your <tr> and </tr> are in the wrong order.

Remove the second c:if and change the first one to


You can still have a minor issue with the last row but that should be hard to solve.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
<c:if test="${ ( (status.index % 5) == 0 && (status.index) != 0) }">
</tr>
<tr>
</c:if>


Thanks to your suggestion but...




which actually means the outside if statement will have to be executed first ... Means I have to create a table row first before I could create a table data. But what I actually need is create 4 table data for every row...




I also tried c:when before, but to no luck... I could not figure out the solution...
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Make it look simpler



[My Blog]
All roads lead to JavaRanch
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, I was able to solve the problem by putting it into paper first... I reversed the way I print the table rows...


Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
nested tables are BAD!!!

why dont you switch to the DIV layout? http://www.snook.ca/archives/000177.php
[ June 19, 2006: Message edited by: Lynette Dawson ]

MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
 
jQuery in Action, 2nd edition
 
subject: EL algorithm help
 
Similar Threads
How to keep the selected value ?
Please help with pagination in JSP?
Internationalization login thru to...
Implementation of google charts in JSP
problem incrementing loop in jstl