Monday, April 18, 2011

How to print a DIV content from a HTML table


Javascript function for printing DIV content from ASP.NET/PHP/ any HTML, etc.

function CallPrint(strid)

{
var prtContent = document.getElementById(strid);
window.document.write(prtContent.innerHTML);
window.document.close();
window.print();
history.back();
}

Call the javascript function as
    OnClientClick="CallPrint('divPrintMessages')"
Hope this will help you....
 

No comments:

Post a Comment