📄 table.jsp
字号:
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#000000">
<%-- 没有查询结果 --%>
<c:if test="${list.size == 0}">
<tr>
<td align="center" bgcolor="#FFFFFF"><font color="#000000" style="font-size:10.5pt;font-family: '宋体';">暂时没有查出任何结果!</font></td>
</tr>
</c:if>
<%-- 有查询结果 --%>
<c:if test="${list.size > 0}">
<%-- 输出表头 --%>
<tr>
<c:forEach var="mapItem" items="${list.list[0].map}">
<td bgcolor="#ffffff"><div align="center" ><strong><font color="#000000" style="font-size:10.5pt;font-family: '宋体';">
<c:out value="${mapItem.key}" default=" " escapeXml="false"/>
</font></strong></div></td>
</c:forEach>
</tr>
<%-- 输出表体 --%>
<c:forEach var="row" items="${list.list}" varStatus="status1">
<c:if test="${row.size > 2}">
<c:if test="${status1.index % 2 == 0}">
<tr bgcolor="#FFFFFF" >
<c:forEach var="item" items="${row.map}" varStatus="status">
<c:if test="${status.first}">
<td align="left"> <font style="font-weight:bold; font-size:10.5pt;font-family: '宋体'; ">
<c:out value="${item.value}" default=" " escapeXml="false"/>
</font>
</td>
</c:if>
<c:if test="${!status.first}">
<td align="right"><font style="font-size:10.5pt;font-family: '宋体'; ">
<c:out value="${item.value}" default=" " escapeXml="false"/>
</font>
</td>
</c:if>
</c:forEach>
</tr>
</c:if>
<c:if test="${status1.index % 2 == 1}">
<tr bgcolor="#EAEAEA" >
<c:forEach var="item" items="${row.map}" varStatus="status">
<c:if test="${status.first}">
<td align="left"> <font style="font-weight:bold; font-size:10.5pt;font-family: '宋体'; ">
<c:out value="${item.value}" default=" " escapeXml="false"/>
</font>
</td>
</c:if>
<c:if test="${!status.first}">
<td align="right"><font style="font-size:10.5pt;font-family: '宋体'; ">
<c:out value="${item.value}" default=" " escapeXml="false"/>
</font>
</td>
</c:if>
</c:forEach>
</tr>
</c:if>
</c:if>
<%-- 如果只有两行,则表示该行为统计行 --%>
<c:if test="${row.size == 2}">
<tr>
<c:forEach var="item" items="${row.map}" varStatus="status">
<c:if test="${status.index == 0}">
<td bgcolor="#FFFFFF" align="left">
<font style="font-weight:bold; font-size:10.5pt;font-family: '宋体'; ">
<c:out value="${item.value}" default=" " escapeXml="false"/>
</font>
</td>
</c:if>
<c:if test="${status.index == 1}">
<td colspan="${list.list[0].size-1}" bgcolor="#FFFFFF" align="left">
<font style="font-weight:bold; font-size:10.5pt;font-family: '宋体'; ">
<c:out value="${item.value}" default=" " escapeXml="false"/>
</font>
</td>
</c:if>
</c:forEach>
</tr>
</c:if>
</c:forEach>
</c:if>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -