jsp页面
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="limit" uri="http://www.yineng.com/limit"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<script src="<%=path%>/js/jquery-1.6.4.min.js" type="text/javascript" ></script>
<link rel="shortcut icon" href="<%=path%>/skin/color1/images/company/favicon.ico" />
<!-- 全局样式引用 -->
<link rel="stylesheet" type="text/css" href="<%=path%>/skin/color1/css/common.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/skin/color1/css/frame.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/skin/color1/css/pageframe.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/skin/color1/css/align_style.css"/>
<style type="text/css">
table.table_my_style{text-align:center; margin:0px auto; border-collapse:collapse; border:solid #bbbbbb; border-width:0 0 0 0px;width:100%;}
table.table_my_style td{border:solid #bbbbbb;border-width:0 1px 1px 0; line-height:28px; padding:0 5px; color:#595757;}
table.table_my_style th{text-align:center; height:28px; font-weight:normal; color:#333333;border:solid #bbbbbb;border-width:0 1px 1px 0; line-height:28px;background-color:#F0F0F0;}
</style>
</head>
<body>
<div class='printTitle'>${stuInfoVo.stuName }学生操行项目达标情况</div>
<h4>学生成绩毕业条件要求</h4>
<table class="tableMainStyle" border="1" >
<tr>
<td colspan="2" class="left_align">${projectPassType }
<c:if test="${itemVo.passType == 0 }">任意一个标准达标即可:<br/> </c:if>
<c:if test="${itemVo.passType == 1 }">所有标准都要达标:<br/> </c:if>
</td>
</tr>
<c:choose>
<c:when test="${! empty itemVo.stuStandardVoList }">
<c:forEach var="x" items="${itemVo.stuStandardVoList }" varStatus="obj">
<tr>
<td class="left_align">
<c:if test="${itemVo.passType != -1 }">${obj.index+1 }.</c:if>
${x.standardInfo }
</td>
<td class="center_align">
<c:if test="${x.passState == '不达标'}">
<font color="red">${x.passState}</font>
</c:if>
<c:if test="${x.passState != '不达标'}">
${x.passState}
</c:if>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<td colspan="2" class="left_align">未给该学生所在班级设置对应的达标标准!</td>
</c:otherwise>
</c:choose>
</table>
<br/>
<h4>学生操行分</h4>
<table class="tableMainStyle" border="1">
<tr>
<th>序号</th>
<th>学期</th>
<th>累积加分</th>
<th>累积加分次数</th>
<th>累积扣分</th>
<th>累计扣分次数</th>
<th>操行分总分</th>
<th>操作</th>
</tr>
<c:choose>
<c:when test="${! empty BehaviorVoList }">
<c:forEach var="x" items="${BehaviorVoList }" varStatus="obj">
<tr>
<td class="center_align"> ${obj.index+1 } </td>
<td class="center_align"> ${x.termName } </td>
<td class="center_align">
<c:if test="${x.behaviorAdd > 0 }">+</c:if>
${x.behaviorAdd } </td>
<td class="center_align"> ${x.behaviorAddCount } </td>
<td class="center_align"> ${x.behaviorReduce } </td>
<td class="center_align"> ${x.behaviorReduceCount } </td>
<td class="center_align"> ${x.behaviorSum } </td>
<td class="center_align">
<a href="#" οnclick="loadStubehavior('${x.termId}',$(this));"> 展开
</a>
</td>
</tr>
<tr style="display: none;" id="tr_${x.termId}">
<td id="td_148" style="margin: 0px;padding: 0px;border: 0px;width: 100%" colspan="8">
<table class="table_my_style">
<thead>
<tr>
<th>序号</th>
<th>类型</th>
<th>考核项</th>
<th>分数</th>
<th>次数</th>
<th>总分</th>
<th>考核日期</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${! empty x.myBehaviorVoList }">
<c:forEach var="y" items="${x.myBehaviorVoList }" varStatus="obj1">
<tr>
<td class="center_align"> ${obj1.index+1 } </td>
<td class="center_align">
<c:if test=" ${y.state == 1 }">加分项</c:if>
<c:if test=" ${y.state == -1 }">加分项</c:if>
</td>
<td class="center_align"> ${y.itemName } </td>
<td class="center_align"> ${y.itemScore } </td>
<td class="center_align"> ${y.behaviorNumber} </td>
<td class="center_align"> ${y.score } </td>
<td class="center_align">
<fmt:formatDate value="${y.optionDate }" pattern="yyyy-MM-dd" />
</td>
<td class="center_align"> ${y.remarks } </td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr><td colspan="8" align="center"><s:text name="nodata" /></td></tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr><td colspan="8" align="center"><s:text name="nodata" /></td></tr>
</c:otherwise>
</c:choose>
</table>
<script type="text/javascript">
var behavior_termId;
//加载学生的操行列表
function loadStubehavior(termId,obj){
//显示列表页面
var isopen = document.getElementById("tr_"+termId).style.display;
if(isopen=="none"){
document.getElementById("tr_"+termId).style.display="table-row";
obj.html("折叠");
} else{
document.getElementById("tr_"+termId).style.display="none";
obj.html("展开");
}
}
</script>
</body>
</html>
跨行显示
<table class="tableMainStyle">
<thead>
<tr>
<th width="60px">序号</th>
<th>收费学期</th>
<th>收费项目</th>
<th>应缴金额</th>
<th>实缴金额</th>
<th>应缴总额</th>
<th>实缴总额</th>
<th>欠费金额</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${!empty requestScope.stuPayInfoVoList}">
<c:forEach var="x" step="1" items="${requestScope.stuPayInfoVoList}" varStatus="status">
<c:forEach var="sub" step="1" items="${x.payItemDetail}" varStatus="substatus">
<tr>
<c:if test="${substatus.index==0}">
<td align="center" rowspan="${x.payItemDetailSize}"><c:out value="${status.index+1}"/></td>
<td align="center" rowspan="${x.payItemDetailSize}" ><c:out value="${x.yearname}"/></td>
</c:if>
<td align="center" ><c:out value="${sub.itemName}"/></td>
<td align="center" ><fmt:formatNumber value="${sub.requiredPay}" pattern="#0.00"/></td>
<td align="center" ><fmt:formatNumber value="${sub.realPay}" pattern="#0.00"/></td>
<c:if test="${substatus.index==0}">
<td align="right" rowspan="${x.payItemDetailSize}">
<fmt:formatNumber value="${x.requiredPayTotal}" pattern="#0.00"/>
</td>
<td align="right" rowspan="${x.payItemDetailSize}" >
<fmt:formatNumber value="${x.realPayTotal}" pattern="#0.00"/>
</td>
<td align="right" rowspan="${x.payItemDetailSize}" >
<fmt:formatNumber value="${x.owePayTotal}" pattern="#0.00"/>
</td>
</c:if>
</tr>
</c:forEach>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="8" align="center"><s:text name="nodata"/></td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>