1 2 3 4 5 6 7 8 |
<span style="color: #33cccc;">function </span>printDiv() { <span style="color: #33cccc;">var </span>divToPrint = document.getElementById('toprint'); newWin= window.open(""); newWin.document.write(divToPrint.innerHTML); newWin.print(); newWin.close(); } |
or use this code in the css
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<head> <style type="text/css"> #printable { display: none; } @media print { #non-printable { display: none; } #printable { display: block; } } </style> </head> <body> <div id="non-printable"> Your normal page contents </div> <div id="printable"> Printer version </div> </body> |
Dein Kommentar
An Diskussion beteiligen?Hinterlasse uns Deinen Kommentar!