title: javascript/jquery print method setting page margin not working
body: <p>I have a function to print my page as follows:</p>
  
  <pre><code>$("#btn_print").click(function () {
  
      var divToPrint = document.getElementById('printdiv');
      var newWin = window.open('', 'Print-Window');
  
      newWin.document.open();
      newWin.document.write('&lt;html&gt;&lt;body onload="window.print()" style="font-family:consolas;@page { size:8.5in 11in; margin: 3cm };" &gt;' + divToPrint.innerHTML + '&lt;/body&gt;&lt;/html&gt;');
  
      newWin.document.close();
      setTimeout(function () {
          newWin.close();
      }, 10);
  
  });
  </code></pre>
  
  <p>I need <strong>3cm</strong> margin space on all sides I mean <code>Top,Right, Bottom and Left</code>.</p>
  
  <p>What I doing is above as you can see:</p>
  
  <pre><code>@page { 
      size: 8.5in 11in;
      margin: 3cm;
  };
  </code></pre>
  
  <p>But it is not working. </p>