The following code creates a hyperlink and uses the Javascript print function to print the current page:
<a href="JavaScript:window.print();">Print this page</a>
function PrintContent() { var DocumentContainer = document.getElementById('historyListPanel'); var WindowObject = window.open('',"TrackHistoryData", "width=740,height=325,top=200,left=250,toolbars=no,scrollbars=yes,status=no,resizable=no"); WindowObject.document.writeln(DocumentContainer.innerHTML); WindowObject.document.close(); WindowObject.focus(); WindowObject.print(); WindowObject.close(); }
pass your table id or div id or contentid
0 comments:
Post a Comment