如何使用JSTL在列中写出对象数组 [英] How to write out an array of objects in columns using JSTL

查看:253
本文介绍了如何使用JSTL在列中写出对象数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个JSP,我正在其中显示项目列表.项目列表将放置在垂直列中.每行应具有(列表长度)/(总行数),如果有剩余则四舍五入.现在我们正在做两列,但我们希望可以自由更改列数.

I have a JSP that I am displaying a list of items on. The list of items will be placed into vertical columns. Each row should have (length of list)/(total number of rows), rounding up if there is a remainder. Right now we are doing two columns, but we want the freedom to change the number of columns.

我的工作不喜欢scriptlet,那么使用JSTL将列表分成相等的列的最佳方法是什么?

My work doesn't like scriptlets, so what is the best way to divide a list into equal columns using JSTL?

推荐答案

我会给您与Evgeny给出的答案相似的答案,但准确一些.但是我需要做以下假设:

I will give you a similar answer to the one from Evgeny but a bit more accurate. But I need to make the following assumptions:

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆