1function PrintElem() {
2 var mywindow = window.open('', 'PRINT');
3 mywindow.document.write('<html><head><title>Payment Slip</title>');
4 mywindow.document.write('</head><body style="text-align:center;font: Georgia, "Times New Roman", Times, serif;background: #fff;font-size: 22pt;margin:20px auto auto 50px;" >');
5 mywindow.document.write('<header style="text-align:center; white-space:nowrap;overflow:hidden;line-height: 1em;">' +
6 '<p style="font-size:16pt;white-space:nowrap;overflow:hidden;line-height: 12pt;">Payment Slip</p>' +
7 '<p style="font-size:16pt;white-space:nowrap;overflow:hidden;line-height: 1em;">' + $('.mylabelpaymentheader').html() + '</p>' +
8'</header>');
9 mywindow.document.write('<content style="text-align:center;">' +
10 '<table style="margin-left: auto;margin-right: auto;border-collapse: collapse;font-size:16pt;">' +
11 '<tr style="border:1px solid black"><td style="border:1px solid black">Name:</td><td style="border:1px solid black">' + $('.lblName').html() + '</td></tr>' +
12 '<tr style="border:1px solid black"><td style="border:1px solid black">Address:</td><td style="border:1px solid black">' + $('.lblAddress').html() + '</td></tr>' +
13 '<tr style="border:1px solid black"><td style="border:1px solid black">Meter No:</td><td style="border:1px solid black">' + $('.lblMeterNo').html() + '</td></tr>' +
14 '<tr style="border:1px solid black"><td style="border:1px solid black">Token:</td><td style="border:1px solid black">' + $('.lblToken').html() + '</td></tr>' +
15 '</table>'+
16
17'</content>' +
18'<footer>' +
19'<hr style="margin-top:30pt;margin-bottom:30pt;">' +
20 '<p style="text-align:right;">© pdb</p>' +
21'</footer>'+
22'');
23 mywindow.document.write('</body></html>');
24 mywindow.document.close(); // necessary for IE >= 10
25 mywindow.focus(); // necessary for IE >= 10*/
26 mywindow.print();
27 mywindow.close();
28 return true;
29}
30