title: How to remove unwanted white space from my print page
body: <p>How to remove unwanted white space from my printed output, while printing my <code>div</code>. I have to print content of DIV like <code>POS</code> receipt but it getting extra white space at top and bottom, I just want print only <code>div</code> content.</p>
  
  <p><a href="https://i.stack.imgur.com/prrYh.jpg" rel="nofollow noreferrer">This image with marked unwanted space</a></p>
  
  <p><a href="https://i.stack.imgur.com/wKlUN.jpg" rel="nofollow noreferrer">This is image of current printing receipt</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>@media print {
    @page {
      size: 100mm 150mm;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;center&gt;
      &lt;div&gt;Job Sheet&lt;/div&gt;
      &lt;h2&gt;
        &lt;b&gt;My Company Name&lt;/b&gt;
        &lt;br/&gt;
  
        &lt;small&gt;My Address here&lt;/small&gt;&lt;br/&gt;
        &lt;small&gt;1234567890, 1234567890&lt;/small&gt;&lt;br/&gt;
      &lt;/h2&gt;
      &lt;hr/&gt;
  
      &lt;table align="center"&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;Date: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="date1" class="printHeading"&gt;000-00-00 00:00:00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;Job No: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="caseid1" class="printHeading"&gt;fgnfg&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;Name: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="name1" class="printHeading"&gt;fgnfgn&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;Address: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="address1" class="printHeading"&gt;fgnfg&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;Mobile: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="mobile1" class="printHeading"&gt;fgnfg&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;Brand: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="brand1" class="printHeading"&gt;fgnfgn&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;Model: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="model1" class="printHeading"&gt;fgsfg&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;IMEI Number: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="imei_number1" class="printHeading"&gt;75375732&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;Problem: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="problem1" class="printHeading"&gt;fgjdfgdfg&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;Amount: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="totalAmount1" class="printHeading"&gt;535&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td class="printHeading"&gt;&lt;b&gt;Assessories: &lt;/b&gt;&lt;/td&gt;
          &lt;td id="assessories1" class="printHeading"&gt;dfgdg&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
  
      &lt;hr/&gt;
      &lt;div&gt;T &amp; C : NO Responsibility of data lost during service all Subject To Gwalior jurisdiction &lt;/div&gt;
    &lt;/center&gt;
    &lt;!-- &lt;div&gt;Exe Name&lt;/div&gt; --&gt;
    &lt;div&gt;
  
      &lt;h5 class="pull-right"&gt;Customer's Signature&lt;/h5&gt;
    &lt;/div&gt;
  
  &lt;/div&gt;
  
  This is my java script function
  
  function printdiv(printpage)
  {
  var headstr = "&lt;html&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;&lt;body&gt;";
  var footstr = "&lt;/body&gt;";
  var newstr = document.all.item(printpage).innerHTML;
  var oldstr = document.body.innerHTML;
  document.body.innerHTML = headstr+newstr+footstr;
  window.print();
  document.body.innerHTML = oldstr;
  return false;
  }</code></pre>
  </div>
  </div>
  </p>