Sunday, May 18, 2014

Partial Page Print in HTML

To print a Partial Part of HTML page……..
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script>
function printDiv()
{
  var printer = window.open('','','width=640,height=700');
 printer.document.open("text/html");
 printer.document.write(document.getElementById('printingstuff').innerHTML);
 printer.document.close();
 printer.window.close();
 printer.print();
 alert("Printing the \"printingstuff\" div...");
}
</script>
<title>Partial Page Printing Test Page</title>
</head>
<body>
<div id="printingstuff">
Hi Sajith, I m going to print now.....!
</div>
<div>
Hai Sajith u cant print me...!
</div>
<br /><span style="color:blue"  onclick="javascript:printDiv()">PRINT THIS PAGE</span>
</body>
</html>


Enjoy!


ref:
http://7explications.wordpress.com/2009/10/22/partial-page-print-in-html/

No comments:

MS in Computer Science with paid training in USA company