简体   繁体   English

IE11打印网站的每一页底部都有几行

[英]IE11 Printing website loses lines at the bottom of every page

I have a web application that displays a grid and a chart with legend. 我有一个Web应用程序,显示带有图例的网格和图表。 The application has the ability to print just the summary chart or the chart with the grid data. 该应用程序能够仅打印摘要图表或带有网格数据的图表。 The grid data is then parsed into a nice printable format for html instead of the table it is in. 然后,将网格数据解析为html而不是其所在表格的漂亮可打印格式。

When attempting to print this I get flawless results in chrome of course. 当尝试打印此图像时,我当然会在chrome中获得完美的结果。 But IE11 cuts things off at the bottom of every page. 但是IE11在每一页的底部都没有内容。 It is almost like it is trying to cut off text. 几乎就像它试图切断文本一样。 About 2-3 lines of text will be cut off for no apparent reason. 没有明显的原因,大约2-3行文字将被剪切掉。 The amount cutoff seems to depend on where it is within a div. 临界值似乎取决于它在div中的位置。 For example if it cuts off in a title it would just be the one line. 例如,如果标题被切掉,那将只是一行。 If it cuts off in the middle of the inner box then it will cut off everything to the end of that box and move to the next section on the next page. 如果它在内部框的中间截断,则它将在该框的末尾截断所有内容,并移至下一页的下一部分。

IE11: IE11: IE11打印图片

Chrome: 铬: 镀铬图片

Things I have already tried: 我已经尝试过的事情:

  1. Removed all floating for display inline-block 删除了所有浮动显示内联块
  2. Made sure overlow was always visible 确保过低总是可见的
  3. changing margins in print preview of IE11 更改IE11的打印预览中的边距
  4. Removed all styles entirely and there was still cutoff from text. 完全删除了所有样式,文本仍然存在中断。

Any help would be greatly appreciated. 任何帮助将不胜感激。

So it took me several days and slowly stripping out everything. 所以花了我几天时间,然后慢慢剥离所有东西。 It appears that I had one element somewhere up the chain not even in the html being presented that was position:absolute. 似乎我在链的某个位置上只有一个元素,甚至在所显示的html中也没有位置:绝对。 I just added: 我刚刚添加:

@media print{
    *{
        float:none!important;
        position:static!important;
    }
}

and everything worked. 一切正常。

Floats and position absolute apparently ruin print in IE. 浮点数和位置绝对值显然会破坏IE中的打印效果。 I recommend never using position absolute for page layout. 我建议不要在页面布局中使用绝对位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM