JSTL

				
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head><title>JSTL Table of Pictures Example</title><head>
<body>
	<table>
	<c:forEach var="item" items="${PICS_AL}" varStatus="status">
		<c:set var="rowIndex" value="${status.index%NUM_PICS_PER_ROW}" />
		<c:if test="${rowIndex==0}">
			<tr>
		</c:if>
		<td>
			<center>
				<img src='<c:out value="${item.pic}"/>'/>					
				<br/> 
				<c:if test='${!empty item.picDesc}'>	
					<br/>
					<c:out value="${item.picDesc}"/>
				</c:if>
			</center>
		</td>
		<c:if test="${rowIndex==NUM_PICS_PER_ROW-1}">
			</tr>
		</c:if>
	</c:forEach>
	
	<c:if test="${rowIndex lt NUM_PICS_PER_ROW-1}">
		<c:forEach begin="${rowIndex+1}" end="${NUM_PICS_PER_ROW-1}" step="${1}">
			<c:set var="rowIndex" value="${rowIndex+1}"/>
			<td>&nbsp;</td>
			<c:if test="${rowIndex==NUM_PICS_PER_ROW-1}">
				</tr>
			</c:if>
		</c:forEach>
	</c:if>

	</table>
</body>
</html>

Figure 2.1. Table of Pictures in Portlets

Pictures Table