Forums Register Login

EL algorithm help

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
<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...
+Pie Number of slices to send: Send
Make it look simpler

+Pie Number of slices to send: Send
Hi, I was able to solve the problem by putting it into paper first... I reversed the way I print the table rows...


+Pie Number of slices to send: Send
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 ]
We're being followed by intergalactic spies! Quick! Take this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1274 times.
Similar Threads
Implementation of google charts in JSP
Please help with pagination in JSP?
Internationalization login thru to...
problem incrementing loop in jstl
How to keep the selected value ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:19:45.