How can I print a certain block/part of a web page? Print option to look like Print Screen functionality.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- Carriage Return (ASCII chr 13) is missing from tex
- void before promise syntax
- Keeping track of variable instances
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.Use css, with the media = print option.
Like:
The blocks you don't want printed can set display:none.