javascript - Resize a div when printing -
I have a div of a gridview that needs to be printed. I'm using a CallPrint JavaScript method to print div. I have to add a header and resize the div to fit the page better. Here is the call print method
function callprint (strid) {var prtContent = document.getElementById (strid); Var WinPrint = window.open ('', '', 'letf = 0, top = 0, width = 800, height = 550, toolbar = 0, scrollbar = 0, position = 0'); WinPrint.document.write (prtContent.innerHTML); WinPrint.document.close (); WinPrint.focus (); WinPrint.print (); WinPrint.close (); Preet content Wiener HTML = strOldOne; } // Generating pop-up print preview page
This is not the way to go.
Instead, you'll see the and lt; Something like link rel = "stylesheet" type = "text / css" media = "print" href = "print.css" /> should be at the top of your HTML file, and by providing Katom CSS for print Change that element. To read more here:
Comments
Post a Comment