是否可以使用其整个宽度在A4上打印div的内容? [英] is it possible to print the contents of a div on an A4 using its whole width?

查看:244
本文介绍了是否可以使用其整个宽度在A4上打印div的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用jquery打印div(包含信息的表格)的内容。我想知道是否可以调整表格的大小以便使用整个A4宽度。



非常感谢

解决方案

你的意思是你想要使用流血直接打印到页面的边缘,或者简单地打印您的导航和其他元素消失,所以宽度可以占用整个打印区域(但仍然有页边距)?我不相信浏览器支持全面流血打印。然而,如果你只想使用带有边距的整个区域,大多数浏览器应该自动调整大小到页面上最大的元素。因此,请使用打印样式表


  • 对于测试,Firebug可以方便地在浏览器中显示打印视图,或者您可以简单地移除media =print

  • 隐藏其他元素并使 div 占据视口的整个宽度

  • 确保使用 width:auto; 即可获得最佳效果。由于纸张和屏幕的比例非常不同,因此您不希望浏览器错误地缩小文字大小,因为两者均以像素为单位定义,并且认为您希望它保持比例。

I want to print the contents of a div(a table containing info) using jquery. I was wondering if it's possible to resize the table in order to use the whole A4s width.

Thanks a lot

解决方案

Do you mean you want to use a bleed to print right up to the edge of the page, or to simply have your navigation and other elements disappear so the width can take up the whole printing area (but still have page margins)?

I don't believe browsers support full bleed printing.

However, if you just want to use the full area with margins, most browsers should auto-size to the largest element on the page. So, use a print stylesheet.

  • For testing, Firebug can conveniently show the print view in the browser, or you can simply remove the media="print"
  • Hide other elements and make the div take up the full width of the viewport
  • Make sure to use width:auto; on that for best results. Since paper and screen are very different proportions, you don't want the browser mistakenly sizing-down your text because both are defined in pixels and it thinks you want it to preserve proportions.

这篇关于是否可以使用其整个宽度在A4上打印div的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆