标签:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 这里要和
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP ‘demo1.jsp‘ starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<h3>初始jstl 做一个表格</h3>
<table border="1">
<c:forEach begin="0" end="3" step="1" var="i" varStatus="sts">
<c:if test="${sts.count%3==0 }">
<tr style="color:red">
</c:if>
<c:if test="${sts.count%3!=0 }">
<tr style="color:green">
</c:if>
<c:forEach begin="0" end="3" step="1" var="j" varStatus="st">
<td>${sts.count+st.count}</td>
</c:forEach>
</tr>
</c:forEach>
</table>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/jiemoxiaodi/p/5236613.html