2017-05-25 34 views
0

我知道我的問題可能與其他問題重複,但我嘗試了其他解決方案,但未能爲我工作。在我的情況,我用header使用靜態頭印刷和使用div我的頁腳和爲我的內容我用表格來顯示數據..當第一頁上的內容溢出時,重複頁眉和頁腳

,所以我現在的問題是,當我試圖打印,如果頁面來自表格的內容溢出,進入第2頁。我想提出的是,當我的表第一頁上溢出時,應及時到第二頁和頁眉和頁腳也將在第二頁看到等..

HEADER

<header> 
     <center><h3><b>Miguel Enrique</b></h3>     
     <p><i>Diplomat<br>Fellow</i><br>Orthopaedic Surgeon</p>   
     </center> 
    </header> 
<div class="row uniform half collapse-at-2"> 
    <div class="12u">          
    <center><h4><b>---data----</b></h4></center> 
    <h4><p>------DATA--------------<br>Tel. 77 19 349 | 65 90 097 
    <br>Mon<b>&middot;</b>Wed<b>&middot;</b>Fri | 3:00pm - 5:00pm 
    <br>Tues<b>&middot;</b>Thurs<b>&middot;</b>Sat | 11:00am - 2:00pm | 
    <br> (All by appointment)</p></h5> 
    </div> 
    <div class="6u"> 
    <div class="row uniform half"> 
     <div class="12u"> 
     <center><h4><b>--DATA---</b></h4></center>              
     <h5><p> ------DATA------- 
     <br>Tel. No. : (632) 789 - 7700 loc. 7330 
     <br>Mon-Thurs: 11am - 4pm | (by Appointment)</p><h5> 
     </div>        
    </div> 
    </div> 
<div  

BODY

<table class="print"> 
    <thead> 
     <tr> 
      <th scope="col"><b>No.</b></th> 
      <th scope="col"><b>Prescriptions</b></th> 
     </tr> 
    </thead> 
    <tbody>           
     <?php foreach($new_array2 as $value) { $inc = @$inc + 1;?> 
     <tr> 
      <td><?php echo $inc; $prescription_array=explode('/',$value);?> 
      </td> 
      <td><?php foreach($prescription_array as $value2) 
       { echo "<h5>".$value2."</h5>"; 
      } ?> 
      </td> 
     </tr> 
      <?php }?> 
    </tbody>                 
</table> 

頁腳

<div class="row uniform half collapse-at-2"> 
    <div class="12u">      
     <div class="row uniform half"> 
      <font size="5"><b>Name</b></font><br> 
      License No. : 1<br> 
     </div> 
    </div> 
</div> 

有沒有什麼辦法解決這個問題?打印時,如果內容在第一頁上溢出,它將轉到第二頁,頁眉和頁腳將顯示在第二頁上。 enter image description here

第一個圖像是關於當我嘗試打印時會發生什麼。我想要實現的是下面的第二張圖片。是否有可能使用谷歌瀏覽器?

回答

0

試試這個:

<header> 
    <center><h3><b>Miguel Enrique</b></h3>     
    <p><i>Diplomat<br>Fellow</i><br/>Orthopaedic Surgeon</p>   
    </center> 
</header> 
<div class="row uniform half collapse-at-2"> 
    <div class="12u">          
    <center><h4><b>---data----</b></h4></center> 
    <h4><p>------DATA--------------<br/> 
     Tel. 77 19 349 | 65 90 097<br/> 
     Mon<b>&middot;</b>Wed<b>&middot;</b>Fri | 3:00pm - 5:00pm<br/> 
     Tues<b>&middot;</b>Thurs<b>&middot;</b>Sat | 11:00am - 2:00pm |<br/> 
     (All by appointment)</p> 
    </h4> 
    </div> 
    <div class="6u"> 
    <div class="row uniform half"> 
     <div class="12u"> 
      <center><h4><b>--DATA---</b></h4></center>              
      <h5><p> ------DATA-------<br/> 
      Tel. No. : (632) 789 - 7700 loc. 7330<br/> 
      Mon-Thurs: 11am - 4pm | (by Appointment)</p></h5> 
     </div>        
    </div> 
    </div> 
</div> 

<table class="print"> 
    <thead> 
     <tr> 
      <th scope="col"><b>No.</b></th> 
      <th scope="col"><b>Prescriptions</b></th> 
     </tr> 
    </thead> 
    <tbody>           
     <?php 
     foreach($new_array2 as $value) 
      { 
       $inc = @$inc + 1; 
     ?> 
     <tr> 
      <td> 
       <?php 
        echo $inc; 
        $prescription_array=explode('/',$value); 
       ?> 
      </td> 
      <td> 
       <?php 
        foreach($prescription_array as $value2) 
         { 
          echo "<h5>".$value2."</h5>"; 
         } 
       ?> 
      </td> 
     </tr> 
     <?php 
      } 
     ?> 
    </tbody>                 
</table> 

頁腳

<div class="row uniform half collapse-at-2"> 
    <div class="12u">      
     <div class="row uniform half"> 
      <font size="5"><b>Name</b></font><br/> 
      License No. : 1<br/> 
     </div> 
    </div> 
</div>