日期:2014-05-17  浏览次数:20888 次

jsp导出excel遇到的样式问题
我是直接在response设置表头属性导出的jsp,可是导出的表格跟我设置的有点区别,不知道怎么回事,求大神指导下是什么问题。这是jsp页面代码
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.util.Random" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html >
<head>
<style type="text/css">
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-center:1px;
mso-ignore:padding;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
width:80px;
height:20px;


}
.xl24
{mso-style-parent:style0;
color:#003366;
font-size:9.0pt;
font-weight:700;
font-family: 2CE 325, sans-serif;
mso-font-charset:0;
text-align:center;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body >
<table border="1" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="xl24" align="center" colspan="2" rowspan="2">姓名</td>
<td class="xl24" align="center" colspan="1" rowspan="2"></td>
<td class="xl24" align="center" colspan="2" rowspan="2">性别</td>
<td class="xl24" align="center" colspan="1" rowspan="2"></td>
<td class="xl24" align="center" colspan="1" rowspan="2">健康状况</td>
<td class="xl24" align="center" colspan="1" rowspan="2"></td>
</tr>
<tr>
<td class="xl24" align="center" colspan="1" rowspan="2">出生年月</td>
<td class="xl24" align="center" colspan="1" rowspan="2"></td>
<td class="xl24" align="center" colspan="1" rowspan="2">民族</td>
<td class="xl24" align="center" colspan="1" rowspan="2"></td>
<td class="xl24" align="center" colspan="1" rowspan="2">籍贯</td>
<td class="xl24" align="center" colspan="1" rowspan="2"></td>
<td class="xl24" align="center" colspan="1" rowspan="2">学历</td>
<td class="xl24" align="center" colspan="1" rowspan="2"></td>
</tr>
<tr>
<td class="xl24" align="center" colspan="1" rowspan="2">专长爱好</td>