<%
response.ContentType ="application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=将网页表格里的数据导出到Excel表格"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body,td{font-size:12px;}
-->
</style>
</head>
<body>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bordercolordark="#FFFFFF">
<tr>
<td width="80" height="22" nowrap> <div align="center"><b>标题</b></div></td>
<td width="80" nowrap><div align="center"><b>标题</b></div></td>
<td width="80" nowrap><div align="center"><b>标题</b></div></td>
<td width="80" nowrap><div align="center"><b>标题</b></div></td>
<td width="80" nowrap><div align="center"><b>标题</b></div></td>
</tr>
<tr>
<td height="22" nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
</tr>
<tr>
<td height="22" nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
</tr>
<tr>
<td height="22" nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
</tr>
<tr>
<td height="22" nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
</tr>
</table>
</body>
</html>
response.ContentType ="application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=将网页表格里的数据导出到Excel表格"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body,td{font-size:12px;}
-->
</style>
</head>
<body>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bordercolordark="#FFFFFF">
<tr>
<td width="80" height="22" nowrap> <div align="center"><b>标题</b></div></td>
<td width="80" nowrap><div align="center"><b>标题</b></div></td>
<td width="80" nowrap><div align="center"><b>标题</b></div></td>
<td width="80" nowrap><div align="center"><b>标题</b></div></td>
<td width="80" nowrap><div align="center"><b>标题</b></div></td>
</tr>
<tr>
<td height="22" nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
</tr>
<tr>
<td height="22" nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
</tr>
<tr>
<td height="22" nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
</tr>
<tr>
<td height="22" nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
<td nowrap><div align="center">数据</div></td>
</tr>
</table>
</body>
</html>
文章来源:桂林唯创网络