• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

logic iterate to display data on multiple columns

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear ranchers

i have to print data to multiple columns using a logic iterate

for eg: the below code would print the same data on each column...
i'd like to see the values for the arraylist like a matrix..

1 2 3
4 5 6
7 8 9

rather than

1 1 1
2 2 2
3 3 3
4 4 4

can anyone suggest how can i achieve this ?


<logic:iterate id="myCollectionElement" collection="<%=drugsList %>" >
<tr>
<td bgcolor="#E9E9E9">
<html:radio property="selectedDrug" value="" /><bean:write name="myCollectionElement" />
</td>
<td bgcolor="#E0E0E0">
<html:radio property="selectedDrug" value="" /><bean:write name="myCollectionElement" />
</td>
<td bgcolor="#E9E9E9">
<html:radio property="selectedDrug" value="" /><bean:write name="myCollectionElement" />
</td>
</tr>
</logic:iterate>
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

try passing a multidiamensional array to the loop. It will be eaiser to handle and you can get the matrix llike structure also.
 
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic