I need to pr开发者_运维问答int the current page in the asp.net application for that I am using javascript:window.print()
.
It's working fine when the page content is within the bounds. However, if the horizontal scrollbar appears as a result of overflow, am able to print only the visible content while the overflown contents couldn't be printed.
Is there any workaround to get this working? Is there any other alternative apart from javascript to achieve this functionality?
you can continue using javascript. however, try embedding this in the <head>
section of your markup:
<style type="text/css" media="print">
#yourDivIdHere{width: 90%; overflow:auto;}
</style>
hope that works!
精彩评论