for循环 jsp页面输出N行3列的表格,完整的代码贴 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <table border="1"> <% for (int n = 1; n <= 100; n++) { %> <tr> <% for (int w = 1; w <= 5; w++) { %> <td width="85"> </td> <% // } %> </tr> <% // } %> </table> 思路,单纯的用jsp中嵌套java代码,还是用el表达式?下面是一种用el表达是些的<table border="1"> <tr> <c:forEach begin="0" end="n" var="ss" varStatus="status"> <td>${ss }</td> <c:if test="${(status.index+1)%3 eq 0}"> </tr> <tr> </c:if> </c:forEach> </tr></table> <%@ page contentType="text/html; charset=gb2312" language="java" %><html><head><title>输出N行3列</title></head><body><center><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#408080" ><% int n=80;/*N 这里就是你要控制的N,自己给值%/ for(int i=1;i<=n;i++) { %> <tr> <% for(int j=1;j<=3;j++); { %> <td> </td> <% } %> </tr><% } %><table></center></body></html> 哪位前辈帮忙解释一下关于投票的代码 谢谢! 关于Quartz的问题 struts2怎么在session中取不到值呢 【100分求救两个问题】图表的穿透式查询 web应用程序的运行问题 JSP代码问题! 询问关于java运行平台和今后平台选择的问题 如何实现在jsp页面上置入日历表,而且在某年某月某日的那个方框里输入内容,比如通过这个来实现每天的日程安排 怎么将javascript中变量赋给java变量 我发现Resin很好用,安装配置也方便,中文支持得也不错! 请教svn同步时,如何设置忽略我本地的文件夹 急! ftp上传视频文件,在客户端访问时,上传失败?
<table border="1">
<%
for (int n = 1; n <= 100; n++)
{
%>
<tr>
<%
for (int w = 1; w <= 5; w++)
{
%>
<td width="85"> </td>
<% //
}
%>
</tr>
<% //
}
%>
</table>
下面是一种用el表达是些的
<table border="1">
<tr>
<c:forEach begin="0" end="n" var="ss" varStatus="status">
<td>${ss }</td>
<c:if test="${(status.index+1)%3 eq 0}">
</tr>
<tr>
</c:if>
</c:forEach>
</tr>
</table>
<%@ page contentType="text/html; charset=gb2312" language="java" %><html>
<head>
<title>输出N行3列</title>
</head>
<body>
<center>
<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#408080" >
<%
int n=80;/*N 这里就是你要控制的N,自己给值%/
for(int i=1;i<=n;i++)
{
%>
<tr>
<%
for(int j=1;j<=3;j++);
{
%>
<td> </td>
<%
}
%>
</tr><%
}
%>
<table>
</center>
</body>
</html>