grails/groovy中将html横向写到word中

在网上收了收主要就是通过css样式把要导入的html设置为横向的

首先在页面的head中加下面的一段代码 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
@page
    {mso-page-border-surround-header:no;
    mso-page-border-surround-footer:no;}
@page Section1
    {size:841.9pt 595.3pt;
    mso-page-orientation:landscape;
    margin:89.85pt 72.0pt 89.85pt 72.0pt;
    mso-header-margin:42.55pt;
    mso-footer-margin:49.6pt;
    mso-paper-source:0;
    layout-grid:15.6pt;}
div.Section1
    {page:Section1;}
-->
</style>
</head>
然后用div包含整个的显示内容,会调用上面的style

<div class="Section1">

</div>

 我通过以上的方法,实现了!

posted @ 2016-04-20 16:48  readygo  阅读(527)  评论(0编辑  收藏  举报