Printing part of the page.
function printPartOfPage(Div)
{
var printContent = document.getElementById(Div);
var windowUrl = 'about:blank';
var uniqueName = new Date();
var windowName = 'Print' + uniqueName.getTime();
var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');
//document.getElementById("button").style.visibility="hidden";
printWindow.document.write(document.getElementById("table").innerHTML);
printWindow.document.write(printContent.innerHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();
document.getElementById("button").style.visibility="visible";
return false;
}
If you like this article, subscribe to our
RSS Feed. You can also
subscribe via email to our Interview Questions, Codes and Forums section.