title: How to Print the Particular bootstrap Div
body: <p>I would like to <strong>print</strong> a <strong>bootstrap div</strong>.</p>
  
  <p>It is properly displayed in web browser but when I click on the print button then at print preview, the elements are floating and are not properly displayed.</p>
  
  <p>what should I do to solve this problem ?</p>
  
  <p><strong>Div which I want to print with following this style</strong>
  <a href="https://i.stack.imgur.com/pqmK4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pqmK4.jpg" alt="enter image description here"></a></p>
  
  <p><strong>What I get the output at printing time which I dont want see on school name at the top</strong>
  <a href="https://i.stack.imgur.com/s9dJ1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s9dJ1.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Button which call the print function:</strong></p>
  
  <pre><code>&lt;button class="btn btn-default" onclick="printDiv('printableArea')"&gt;&lt;i class="fa fa-print" aria-hidden="true" style="    font-size: 17px;"&gt; Print&lt;/i&gt;&lt;/button&gt;
  </code></pre>
  
  <p><strong>Print Function:</strong></p>
  
  <pre><code>function printDiv(divName) {
       var printContents = document.getElementById(divName).innerHTML;
       var originalContents = document.body.innerHTML;
  
       document.body.innerHTML = printContents;
  
       window.print();
  
       document.body.innerHTML = originalContents;
  }
  </code></pre>
  
  <p><strong>Div which i Want to print</strong></p>
  
  <pre><code>&lt;div class="container right-container col-md-6" id="printableArea" style="display:block;"&gt;
      &lt;span id="link7"&gt;   
          &lt;div class="row"&gt;
              &lt;div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"&gt;
                  &lt;h3 id="school_title"&gt;&lt;?php echo "$school_name";?&gt; &lt;/h3&gt;
                  &lt;p&gt;&lt;p&gt; 
                  &lt;p style="font-size: 1.1em;" id="exam_title"&gt;Annual Examination [ 2015-2016 ] &lt;p&gt; 
                  &lt;div class="row"&gt;
                      &lt;div class="col-md-4"&gt;
                          &lt;div class="header-time-date-marks"&gt;
                              &lt;span id="exam_time"&gt;Time: 12 AM - 2 PM&lt;/span&gt;
                              &lt;span id="exam_date"&gt;Date: 30/12/2016&lt;/span&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="col-md-8 header-time-date-marks" style="text-align: right;padding-right: 36px;"&gt;
                          &lt;span id="exam_marks"&gt;100 Marks&lt;/span&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;hr / id="line" style="margin-top: 13px;"&gt;
          &lt;div class="row q-question-type-style" id='question_section'&gt;
          &lt;/div&gt;
      &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>