将word另存为html文件,加入jstl标签导出时,打开默认为web版式视图,如下
如上图可视,显示效果特别差,如果我们想将其改为常用的页面视图,只需将下面的代码段替换到模板jsp中即可
<strong><span style="font-size:18px;"><span style="font-size:18px;"><html xmlns:w="urn:schemas-microsoft-com:office:word">
<head>
<!--[if gte mso 9]>
<xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:DoNotOptimizeForBrowser/>
<w:Compatibility>
<w:DontGrowAutofit/>
</w:Compatibility>
</w:WordDocument>
</xml>
<![endif]-->
<style type="text/css">
<%= global_style %>
<%= report_style %>
</style>
</head>
<body>
<div id="word-export" class="WordSection1">
</span></span></strong>
替换后的: