Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Wiki
Search Coderanch
Advanced search
Google search
Register / Login
Bookmark Topic
Watch Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Devaka Cooray
Campbell Ritchie
Tim Cooke
Ron McLeod
Liutauras Vilda
Sheriffs:
Junilu Lacar
paul wheaton
Paul Clapham
Saloon Keepers:
Piet Souris
Bartenders:
Forum:
Wiki
Jstl Table
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ page import="java.util.*" %> <% // Ugly scriptlet code that belongs in a model object somewhere List rows = new ArrayList(); request.setAttribute("rows", rows); for(int i = 1; i <=12; i++){ List cols = new ArrayList(); for(int j = 1; j <=12; j++){ cols.add(String.valueOf(i * j)); } rows.add(cols); } %> <html> <head> <title>nested forEach tags</title> </head> <body> <table border="1"> <c:forEach var="row" items="${rows}"> <c:forEach var="col" items="${row}"> |${col} </c:forEach> | </c:forEach> [/table] </body> </html>
JspFaq
Don't get me started about those stupid
light bulbs
.
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Using Two ArrayLists For One Table
Resultset elements not getting displayed in jsp when using JSP/JSTL
Bean String contains opening and closing td tags
What is best way to display a results set from a database?
Servlet to JSP using Tomcat 7 inside eclipse (JUNO)
More...