2017-02-20 4 views
-1

動的コンテンツを含むHTMLページの一部を、大きなスペースをヘッダーとしてPHPで印刷しようとしています。印刷する。私はクロムのために完璧な結果を得ましたが、火災はクロムのように印刷されませんでした。jqueryprint.jsで印刷するときにコンテンツの前に余分な1pageを表示するFirefoxブラウザ

なぜFirefoxが前に余分なページを追加していますか?内容がなくても大丈夫です。しかし、divやmarginの内容や高さを追加する場合は、余分なページを追加してヘッダーのみを印刷します。

印刷のためのHTMLコードstuctureは、Firefoxの前に余分なページを追加している理由は、このための

<section class="panel" id="payablePrint"> 
    <table> 
    <thead > 
     <tr> 
     <th style="width:100%"> 
      <div id="print_header"style="opacity: 0.001;"> 
       Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
       Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
       Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. 
      </div> 
     </th> 
    </tr> 
    </thead> 
    <tbody> 
    <tr> 
     <td> 
      <table style="width:100%"> 
      <tr> 
       <th>Firstname</th> 
       <th>Lastname</th> 
       <th>Age</th> 
      </tr> 
      <tr> 
       <td>Jill</td> 
       <td>Smith</td> 
       <td>50</td> 
      </tr> 
      <tr> 
       <td>Eve</td> 
       <td>Jackson</td> 
       <td>94</td> 
      </tr> 
    </table> 
     </td> 
    </tr> 
    </tbody> 
    <tfoot> 
    <tr> 
     <td> 
      footer here....,. 
     </td> 
    </tr> 
    </tfoot> 
    </table> 
    </section> 
    <div class="row"> 
    <div class="col-lg-12 text-right"> 
    <button id="" onclick="printDiv('payablePrint')" class="btn btn-shadow btn-primary jdIconButton"><i class="fa fa-print"></i> Print Agreement</button> 
    </div> 
</div> 

とCSSが

@media print{ 

#print_header{ 
    display: block; 
    } 
    #Footer{ 
    display: none !important; 
    margin-bottom: 0px; 
    margin-top: 0px; 
    } 
    #printFooter { 
    display: block; 
    position: fixed; 
    bottom: 0px; 
    left: 154px; 
    } 
.panel-footer{ 
    border-top: none !important; 
} 
/* *************** */ 
thead { display: block; page-break-after: avoid;page-break-before: avoid;} 
table { page-break-after:auto; } 
tr { page-break-inside:avoid; page-break-after:auto; } 
td { page-break-inside:avoid; page-break-after:auto; } 
thead { display:table-header-group; page-break-before: avoid;} 
tboby { display: table-row-group;page-break-after: avoid;page-break-before: avoid;} 
tfoot { display:table-footer-group;} 
/* *************** */ 

#footer { 
    display: block; 
    position: fixed; 
    bottom: 0; 
} 
#companyName{ 
    margin-top: -10px !important; 
} 
.panel-body{ 
    margin: -1mm 0mm 10mm 0mm !important; 

} 

.agreement_title{ 
    margin-top: -15px !important; 
} 
.margin_top{ 
    margin-top: -6px !important; 
} 

} 

あるのですか?内容がなくても大丈夫です。しかし、divやmarginの内容や高さを追加した場合は、余分なページをヘッダだけで追加します。 どんな種類のヘルプも素晴らしいでしょう!

答えて

0

必要に応じてcolspanとrowspanを使用します。メインテーブル内の子テーブルを削除します。以下のコードを確認してください。..

<section class="panel" id="payablePrint"> 
 
    <table> 
 
    <thead > 
 
     <tr> 
 
     <th style="width:100%"> 
 
      <div id="print_header"style="opacity: 0.001;"> 
 
       Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
 
       Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
 
       Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. 
 
      </div> 
 
     </th> 
 
    </tr> 
 
    </thead> 
 
    <tbody> 
 
    <tr> 
 
     <td> 
 
      content goes here ...... 
 
     </td> 
 
    </tr> 
 
    </tbody> 
 
    <tfoot> 
 
    <tr> 
 
     <td> 
 
      footer here....,. 
 
     </td> 
 
    </tr> 
 
    </tfoot> 
 
    </table> 
 
    </section> 
 
    <div class="row"> 
 
    <div class="col-lg-12 text-right"> 
 
     <button id="" onclick="printDiv('payablePrint')" class="btn btn-shadow btn-primary jdIconButton"><i class="fa fa-print"></i> Print Agreement</button> 
 
    </div> 
 
    </div>

関連する問題