title: How to print data by current table on page in Laravel 5?
body: <p>My problems are:</p>
  
  <ol>
  <li>When I click the print button, it shows the data by text not in table. </li>
  <li>I want to print data table depends on the current table show. means
  here is on the current page has list of all data and select option.
  When I select or filter table it still print all the data. The data
  here is collected from database.</li>
  <li>After logged in, why does the image for next page not show?</li>
  </ol>
  
  <p>Here is my JavaScript:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script lang='javascript'&gt;
      $(document).ready(function(){
          $('#printPage').click(function(){
              var data = '&lt;input type="button" value="Print this page" onClick="window.print()"&gt;';
              data += '&lt;div id="div_print"&gt;';
              data += $('#report').html();
              data += '&lt;/div&gt;';
  
              myWindow=window.open('','','width=200,height=100');
              myWindow.innerWidth = screen.width;
              myWindow.innerHeight = screen.height;
              myWindow.screenX = 0;
              myWindow.screenY = 0;
              myWindow.document.write(data);
              myWindow.focus();
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Blade template:</p>
  
  <pre><code> &lt;tbody id="result"&gt;
  
          @foreach($profiles as $profile)
          &lt;tr&gt;
              &lt;td class="student_id" width="15%"&gt;{{$profile-&gt;student_id }}&lt;/td&gt;
              &lt;td class="name" width="30%"&gt;{{$profile-&gt;student_name }}&lt;/td&gt;
              &lt;td class="program" width="30%"&gt; {{$profile-&gt;program }}&lt;/td&gt;
              &lt;td class="faculty" width="25%"&gt;{{$profile-&gt;faculty }} &lt;/td&gt;
          &lt;/tr&gt;
              @endforeach
          &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;p align="center"&gt;&lt;button id="printPage"&gt;Print&lt;/button&gt;&lt;/p&gt;
  </code></pre>