I am trying to create a grid using JSTL <c:forEach>.
<c:forEach var="user" items="${userList}" step="1" begin="0">
<div id="col1">
<a href="#">${user.userName}</a>
</div>
<div id="col2">
<a href="#">${user.userName}</a>
</div>
<div id="col3">
<a href="#">${user.userName}</a>
</div>
</c:forEach>
The output is:
user1 user1 user1
user2 user2 user2
user3 user3 user3
and so on...
But I want it to display like:
user1 user2 user3
user4 user5 user6
user7 user8 user9
and so on...
My CSS is:
#col1 {
position: absolute;
left: 5px;
padding: 0px;
}
#col2 {
position: absolute;
margin-left: 100px;
padding: 0px;
}
#col3 {
margin-left: 200px;
padding: 0px;
}
How can I achieve this without using a table?
You need to declare a status variable, please try: