Forums Register Login

Format column display - JSTL

+Pie Number of slices to send: Send
I have a table that is currently displaying like so:



and now I would like for it to display like this:



Is there an easy way to get this format with the code below or should I just rework my backend code? Any direction on this matter would be appreciated. Thanks!

+Pie Number of slices to send: Send
Of course there is. You can either change the format of the HTML such that you can still emit them in order, or you can do some math on the current loop index in order to pick and choose which array element gets emitted for each iteration.

Clues for the latter approach: varStatus gives you information on the current status of each iteration, including the loop index, and the [] operator can be used to index into the array or list. You might also ponder on the begin and end attributes to the <c:forEach> action.
[ March 14, 2008: Message edited by: Bear Bibeault ]
I am mighty! And this is a mighty small ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3851 times.
Similar Threads
Coloring Table Rows Based on Array Value
JSTL List Help
Number of Table Rows Returning Double
Coloring Table Rows
How to prevent DIV from reloading
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:20:12.