【问题标题】:IE 10 print appears to be scaled downIE 10 打印似乎按比例缩小
【发布时间】:2013-12-23 22:14:51
【问题描述】:

我有执行报告打印的 Web 应用程序。 我的代码看起来像这样,并且可以正常工作。

HTML

<table>
    <thead>
        <tr>
            <th>
                Header part
            </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <div id="reportView">
                    <div class="head centerPosition noPrint">
                        Report header
                    </div>
                    <div class="content" style="margin: 0px;">
                        <div id="report" style="margin-top: 10px;">
                            report content
                        </div>
                    </div>
                    <div class="foot noPrint">
                        Report footer
                    </div>
                </div>
            </td>
        </tr>
    </tbody>    
</table>

CSS

<style media="print">
    body
    {
        background-color:#FFFFFF; 
        margin: 0px;  /* this affects the margin on the content before sending to printer */
        width: 100%;
    }


    #site_header, #site_footer, .noPrint
    {
        visibility: hidden;
        display: none;
        height: 0px !important;
        overflow: hidden !important;
    }


    #report .content
    {
        width: 100%; margin: 0px; float: none;
        background: transparent;
    }

    #report {
        background-color: white;
        width: 100%;
    }
</style>

在我打印任何报告后,报告会在纸上按比例缩小。 如果有人知道如何解决这个问题,请帮助我。我尝试在谷歌上搜索,但没有一个建议有效。

在此先感谢...

【问题讨论】:

  • 必问问题:您是否不小心取消了缩放?
  • 你有实时页面来测试吗?
  • 此项目已上线,抱歉,不对外公开

标签: html internet-explorer css internet-explorer-10


【解决方案1】:

我的猜测(因为我现在无法测试)是您还需要在 #report .content 上方的每个容器上声明 width:100%(从您提供的 HTML 来看,它看起来像 #reportViewtabletd 包含所有内容,但可能还有更多)。否则它将折叠到它的内容宽度,这是表格单元格的默认行为。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-18
    • 2015-04-29
    • 2013-06-06
    • 2019-02-26
    • 1970-01-01
    • 2020-06-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多