jsp导出到word,默认显示为web视图,应该该为页面视图

将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>

替换后的:



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值