简体   繁体   中英

Html table won't print full width

帮助,尝试使用html表打印日历,在Mac上但在Windows,所有浏览器上都可以正常打印,无论CSS打印设置是什么,它的顶部都留有3英寸的空白。客户端希望日历打印出完整的出血。我可以将其打印到如果我将浏览器上的打印设置调整为不缩小到适合的大小,然后将其设置为110%,则打印完整尺寸,但是该解决方案搞砸了类型并弄乱了日历中的字符。是否有任何方法可以直接使用CSS?

Add this simple Javascript code to print the calendar

 <script language="javascript"> function Clickheretoprint() { var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; disp_setting+="scrollbars=yes,width=400, height=400, left=100, top=25"; var content_vlue = document.getElementById("print_content").innerHTML; var docprint=window.open("","",disp_setting); docprint.document.open(); docprint.document.write('<html><head><title>Print</title>'); docprint.document.write('</head><body onLoad="self.print()" style="width: 800px; font-size:12px; font-family:arial;">'); docprint.document.write(content_vlue); docprint.document.write('</body></html>'); docprint.document.close(); docprint.focus(); } </script> 
 <a href="javascript:Clickheretoprint()">Print</a> <div id="print_content" style="width: 100%;"> Calendar/html table goes here </div> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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