<table border="1" > <%-- Get the column names for the header of the table --%> <c:forEach var="columnName" items="${emp.columnNames}"> <th><c:out value="${columnName}"/></th> </c:forEach> <%-- Get the value of each column while iterating over rows --%> <c:forEach var="row" items="${emp.rowsByIndex}"> <tr> <c:forEach var="column" items="${row}"> <td><c:out value="${column}"/></td> </c:forEach> </tr> </c:forEach> </table>