My goal is to display my data in database just like in the image below.
I am using JSTL <c:forEach>
.
<c:forEach items="${table}" var="table">
<img height="70" src="${table.images}" />
Table ${table.tableId}
</c:forEach>
How can I print a <table>
with 5 columns?
Something like:
<table>
<c:forEach items="${list}" var="row" varStatus="rowCounter">
<c:if test="${rowCounter.count % 5 == 1}">
<tr>
</c:if>
<td><img src="${row.imageUrl}"/><br/>Table ${rowCounter.count}</td>
<c:if test="${rowCounter.count % 5 == 0||rowCounter.count == fn:length(values)}">
</tr>
</c:if>
</c:forEach >
</table>