Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. $("#printBtn").click(function(){
  2. printcontent($("#YearWise").html());
  3. });
  4.  
  5. function printcontent(content)
  6. {
  7. var mywindow = window.open('', '', '');
  8. mywindow.document.write('<html><title>Print</title><body>');
  9. mywindow.document.write(content);
  10. mywindow.document.write('</body></html>');
  11. mywindow.document.close();
  12. mywindow.print();
  13. return true;
  14. }
  15.  
  16. <button id="printBtn">Click Print</button>
  17.  
  18. <div id="YearWise" style="display: none">
  19. <p style="position: absolute; color: rgb(172, 166, 166); font-family: calibri; font-size: 25px; font-variant: small-caps; font-weight: 100; margin-left: 514px; padding-top: 75px;">Report</p>
  20. <span style="position: absolute; color: rgb(138, 138, 138); font-family: calibri; font-size: 31px; font-variant: small-caps; margin-left: 466px; padding-top: 42px;">Year Wise</span>
  21.  
  22. <div id="main" style="display: block; background-color: rgb(228, 228, 228)"
  23. <input id="ChangeYear" class="date-pickerY" style="text-transform:uppercase; font-family: calibri; font-size: 18px; margin-top: -135px; margin-left: 416px; width: 160px; height: 24px; border: 1px solid #717271; color: rgb(68, 68, 68); padding-left: 6px" />
  24. <img style="margin-left: -32px; margin-top: -134px; cursor: pointer; height: 28px;" src="../../img/Date.png" onClick="OpenDatePicker('ChangeYear')"/>
  25.  
  26. <ul id="holder" style="height: 785px; width: 1059px; margin-left: -25px; margin-top: -32px; margin-right: -26px; border-radius: 0px;">
  27. <li style="width: 1021px; height: 981px; background-color: whitesmoke; border-radius: 0px; margin-top: 5px; margin-left: 0px; margin-right: 0px; padding-bottom: 94px;">
  28.  
  29. <br>
  30.  
  31. <div id="YearTable">
  32. <div class="block">
  33. </div>
  34. </div>
  35.  
  36. </li>
  37. </ul>
  38. </div>
  39. </div>
  40.  
  41. mywindow.document.write("<link rel="stylesheet" type="text/css" href="yourpathstyle.css" />");
  42.  
  43. mywindow.document.write('<link rel="stylesheet" type="text/css" href="yourpathstyle.css" />');
  44.  
  45. mywindow.document.write("<link rel="stylesheet" type="text/css" href="yourpathstyle.css" />");
  46.  
  47. <link rel="stylesheet" type="text/css" href="style.css" media="print">
  48.  
  49. <link rel="stylesheet" type="text/css" href="main.css"> // this css will be used on page
  50. <link rel="stylesheet" type="text/css" href="style.css" media="print"> // this css will be used if you try to print your page
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement