• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jstl + forEach + x number of items per row

 
jensen mcjensenson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a list of name Strings. I want to print them out in a table, but three per row. How do I use jstl forEach to do this ?

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
eastwoj Eastwood

Welcome to JavaRanch. We don't have too many rules around here but we do have a Naming Policy. Please read this and adjust your display name accordingly.

Thanks.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As to your question, use the varStatus attribute to keep a counter and check that counter in the iteration to determine when to start a new row.
 
jensen mcjensenson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks! can you show me an example, though? .. i usually end up with this output:

name1, name1
name2, name2
name3, name3
...
...

when i want this:

name1, name2
name3, name4
...


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"jensen2009 jensen", Gregg's request that you change your display name to adhere to JavaRanch standards was not a suggestion. Valid display names are mandatory for participation on the Ranch. Please change your display name as instructed prior to your next post.

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff
 
jensen mcjensenson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, misread the policy.. any suggestions on my question ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You apparently missed the "not obviously fictitious" part. Your account is one breath away from being disabled. Please use your real name or at least one that is not obviously not.
 
jensen mcjensenson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok how is this "made up name" any more real than your "made up name" ? this is getting rediculous .. go ahead and disable it. I'll go somewhere else where people are more interested forum activity than jumping through name hoops.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't about my name, it's about yours. My display name was validated over 13,000 posts ago. It's the name on my office nameplate, and it's the name on my business cards. Can you say the same about yours?

We hate to see you go, there's a lot of value to be had here, and all we ask that you use your real name or at least one that doesn't look like a nose-thumbing at the policy.

E-mail me should you wish your account re-instated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic