You must use separate css for print media. This allows you to hide / show parts of the page when printing. A.
html:
<div class="dont-print-that">
blah
</div>
print this!
include:
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
print.css
.dont-print-that{display:none;}
Another solution is to open a new window only with the content you want to print. You can either do this in a popup or in an iframe. Personally, I think the CSS solution is more elegant, but it's up to you.
source
share