During Javascript printing, the formatting not preserved

sarisari

New Member
I want to print an aspx page content. The page has several asp.net labels which display data. I am using javascript to print the page. It prints but the problem is the formatting is gone. For example, the first few rows of the page look like as shown below:Field name Old Value New ValueAddress1 1323 Bker street 5645 Lamar RoadIn the preview and the printed page, the data are in six lines, instead of the two shown above. Looks like that a new line character is introduced after each label.\[code\]function doPrint(s, e) { var prtContent = document.getElementById('PrintPanel'); prtContent.border = 0; //set no border here var WinPrint = window.open('', '', 'left=100,top=100,width=1000,height=1000,toolbar=0,scrollbars=1,status=0,resizable=1'); WinPrint.document.write(prtContent.innerHTML); WinPrint.document.close(); WinPrint.focus(); WinPrint.print(); WinPrint.close(); }\[/code\]
 
Back
Top