• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

logic iterate to display data on multiple columns

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic