How can I print a certain block/part of a web page?
Asked Answered
U

2

3

How can I print a certain block/part of a web page? Print option to look like Print Screen functionality.

Underlay answered 9/2, 2010 at 7:42 Comment(0)
C
7

Use css, with the media = print option.

Like:

<link rel="stylesheet" type="text/css" href="print.css" media="print" />

The blocks you don't want printed can set display:none.

Cello answered 9/2, 2010 at 7:45 Comment(0)
B
0

See http://www.quackit.com/javascript/javascript_print.cfm

You can use javascript's window.print() to print the page. To restrict the printed content to a specific part of the page, you can create a print stylesheet (see http://www.alistapart.com/articles/goingtoprint/) that hides all but the desired content.

Barraza answered 9/2, 2010 at 7:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.