本文介紹了CSS:分頁后重復表頭(打印視圖)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
我有用于打印重復頁眉和頁腳的 html 表格.一切正常,文檔自動中斷.但現在我想在任何元素之后打破頁面.我使用 css 屬性 page-break-after 并將其設置為始終.是的,它的作品,但我有另一個問題.休息后的頁面不要重復表格的頁眉和頁腳.怎么了?
I have html table for printing with repeat header and footer. Everything works, document to break automatically. But now i would like to break page after any element. I use to css property page-break-after and set it to always. Yes, its works, but i got another problem. Page after break dont repeat header and footer of table. What is wrong?
瀏覽器:IE8.
打印樣式:
table thead {display: table-header-group;}
table tfoot { display: table-footer-group;}
table tbody { display: table-row-group;}
.page-break { page-break-after:always;}
HTML代碼:
<table>
<thead>
<tr>
<th>...</th>
</tr>
</thead>
<tfoot>
<tr>
<td>...</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>page 1</td>
</tr>
<tr class="page-break">
<td>content</td>
</tr>
<tr>
<td>Page 2</td>
</tr>
<tr>
<td>content 2</td>
</tr>
</tbody>
</table>
推薦答案
嘗試添加以下css:
thead {display: table-header-group;}
頁腳不在每一頁重復,而是打印在最后一頁只在IE8,iirc中.
The footer is not repeated on each page, but rather printed on the last only in IE8, iirc.
這篇關于CSS:分頁后重復表頭(打印視圖)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!