加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – 打印预览在每页上重复tfoot

发布时间:2020-12-14 18:26:10 所属栏目:资源 来源:网络整理
导读:我的问题是,我有两个不同的html文件,其中包含一个包含theader,tfooter和tbody的表. 第一个是我自己创建的测试原因,它看起来像这样: htmlhead titleThe Invoice/title style type="text/css" table.invoice { background-color: #dddddd; font-family: sans-
我的问题是,我有两个不同的html文件,其中包含一个包含theader,tfooter和tbody的表.

第一个是我自己创建的测试原因,它看起来像这样:

<html>
<head>
    <title>The Invoice</title>
    <style type="text/css">

    table.invoice { background-color: #dddddd; font-family: sans-serif; }

    td,th { background-color: #ffffff; padding: 5pt; }
    td.unit { text-align: right; }
    td.price { text-align: right; }

    thead { display: table-header-group; }
    tfoot th { text-align: right; }

    </style>
</head>
<body>
    <div style="width:auto !important; overflow:hidden; position:relative">
    <table class="invoice" cellspacing="1" cellpadding="0">
        <thead>
           <th>Unit</th>
           <th>Description</th>
           <th>Price</th>
        </thead>
        <tfoot>
           <tr>
             <th colspan="2">Sum</th>
             <td class="price">1.230,32 EUR</td>
           </tr>
        </tfoot>
        <tbody> 
               <tr><td>1</td><td>Excel</td><td >150,00 EUR</td></tr>
               <tr><td>2</td><td>Document</td><td>150,00 EUR</td></tr>
                            ... and so on ...
        </tbody>
    </table>
    </div>
</body>
</html>

每当我在IE9上尝试打印预览时,它会在最后一页显示tfoot(在我的例子中为第5页),它显示了正文内容价格列的总和.
当我在Mozilla Firefox 11.0中尝试相同时,它会在每个页面上显示tfoot的总和,当然我不想要.

我问的主要原因是因为我有一个FreeAgent html dom,我想打印一些Invoice.有了那个html文件,甚至IE9在每一页上显示了tfoot,再次!,我不想要.

我一起玩

@media print { tfoot { display: table-footer-group;
                 position: absolute;        
                 bottom: 0; }}

在那里它只显示一次页脚,但是在左下角的第一页上,所有内容都与我的其他文本相对应…

很感激的想法或解决方案!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读