做了一个jsp页面,页面就一个table
想导出数据
<%
response.setHeader("Content-disposition","inline;filename=result.xls");
response.setContentType("application nd.ms-excel; charset=GB2312");
%>table也设置了border
点导出按钮之后,如果直接打开,Excel是有边框的
如果下载到本地,然后打开,就没有边框
有什么办法处理?在线等.....
想导出数据
<%
response.setHeader("Content-disposition","inline;filename=result.xls");
response.setContentType("application nd.ms-excel; charset=GB2312");
%>table也设置了border
点导出按钮之后,如果直接打开,Excel是有边框的
如果下载到本地,然后打开,就没有边框
有什么办法处理?在线等.....
你只要把 JSP里的单元格的内容填到 EXCEL就行了。
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:DefaultRowHeight>285</x:DefaultRowHeight>
<x:Print>
<x:ValidPrinterInfo/>
<x:PaperSizeIndex>9</x:PaperSizeIndex>
<x:HorizontalResolution>200</x:HorizontalResolution>
<x:VerticalResolution>200</x:VerticalResolution>
</x:Print>
<x:CodeName>Sheet1</x:CodeName>
<x:Selected/>
<x:Panes>
<x:Pane>
<x:Number>3</x:Number>
<x:ActiveRow>8</x:ActiveRow>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight>4530</x:WindowHeight>
<x:WindowWidth>8505</x:WindowWidth>
<x:WindowTopX>480</x:WindowTopX>
<x:WindowTopY>120</x:WindowTopY>
<x:AcceptLabelsInFormulas/>
<x:ProtectStructure>False</x:ProtectStructure>
<x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->