Scuffman gave a good answer. Alternatively, you can also just put <tr> outside the loop and print an intermediate </tr><tr> at the right times (i.e., every third element).
<table> <tr> <c:forEach items="${lstProduct}" var="product" varStatus="loop"> <c:if test="${not loop.first and loop.index % 3 == 0}"> </tr><tr> </c:if> <td> ${product.id} ${product.name} </td> </c:forEach> </tr> </table>
Balusc
source share