jsp实现 页面excel的导出

 

 

<%@ page contentType="application/vnd.ms-excel;" language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ include file="/common.jsp"%>
<%   response.setHeader("Content-disposition","attachment; filename=数据.xls");%>
  
<html>
<head>
<title> 无</title>
<meta http-equiv="Content-Type" content="application/vnd.ms-excel; charset=GBK">
<style type="text/css">
BODY {
	MARGIN-TOP: 0px
}
td {
	FONT-SIZE: 14px;
	LINE-HEIGHT: 1.8;
}
a:link, a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a.s1:link, a.s1:visited {
	text-decoration: none;
	color: #000000
}
a.s1:hover {
	text-decoration: underline;
	color: #c00;
}
</style>
</head>
<body topmargin="0">
<center>
<table width="100%" border="0" align="center" cellPadding="0" cellSpacing="1">
    <tbody>                                  
    <tr bgcolor="#FFFFFF">
      <td align="center" valign="top" class="f12"><table width="99%" border="0" cellpadding="1" cellspacing="1" bgcolor="#F0F0F0">
          <tr bgcolor="#F0F0F0">
            <td align="center"><b>&nbsp;姓名</b> </td>
            <td align="center"><b>&nbsp;用户名</b> </td>
            <td align="center"><b>&nbsp;省份</b> </td>
            <td align="center"><b>&nbsp;身份证 </b> </td>
          </tr>
            <tr>
              <td align="center" bgcolor="#FFFFFF"> 123</td>
              <td align="center" bgcolor="#FFFFFF"> 小米</td>
              <td align="center" bgcolor="#FFFFFF"> 黑龙江</td>
              <td align="center" bgcolor="#FFFFFF"> 232101198412003431</td>
             </tr>
           
          </c:if>
        </table>
      </td>
    </tr>	
    </tbody>
</table>	
</center>
</body>
</html>

 

 

 

你可能感兴趣的:(html)