Php 在分页符css html之后显示当前表格标题

Php 在分页符css html之后显示当前表格标题,php,jquery,html,css,print-preview,Php,Jquery,Html,Css,Print Preview,这是我的问题。它与我在这里看到的一些类似(即),但有一个区别:多个标题 如何显示动态表格中断后发生页面中断(在打印预览模式下)的当前表格标题 因此,如果这是我的表,并且分页符出现在第二个标题之后 <table> <tr><th>Head Cell 1a</th><th>Head Cell 2a</th><th>Head Cell 3a</th></tr> <tr>

这是我的问题。它与我在这里看到的一些类似(即),但有一个区别:多个标题

如何显示动态表格中断后发生页面中断(在打印预览模式下)的当前表格标题

因此,如果这是我的表,并且分页符出现在第二个标题之后

<table>
    <tr><th>Head Cell 1a</th><th>Head Cell 2a</th><th>Head Cell 3a</th></tr>
    <tr><td>Cell 1a</td><td>Cell 2a</td><td>Cell 3a</td></tr>
    <tr><td>Cell 4a</td><td>Cell 5a</td><td>Cell 6a</td></tr>   

    <tr><th>Head Cell 1b</th><th>Head Cell 2b</th><th>Head Cell 3b</th></tr>
    <tr><td>Cell 1b</td><td>Cell 2b</td><td>Cell 3b</td></tr>

    <!--PAGE BREAK HERE ON PRINT PREVIEW-->
    <tr><td>Cell 4b</td><td>Cell 5b</td><td>Cell 6b</td></tr>
</table>
但是第一个标题在每一页上不断重复,所以我看到的是:

<table>
    <thead><tr><th>Head Cell 1a</th><th>Head Cell 2a</th><th>Head Cell 3a</th></tr></thead>
    <tr><td>Cell 1a</td><td>Cell 2a</td><td>Cell 3a</td></tr>
    <tr><td>Cell 4a</td><td>Cell 5a</td><td>Cell 6a</td></tr>   

    <thead><tr><th>Head Cell 1b</th><th>Head Cell 2b</th><th>Head Cell 3b</th></tr></thead>
    <tr><td>Cell 1b</td><td>Cell 2b</td><td>Cell 3b</td></tr>

    <!--PAGE BREAK HERE ON PRINT PREVIEW-->
    <thead><tr><th>Head Cell 1a</th><th>Head Cell 2a</th><th>Head Cell 3a</th></tr></thead>
    <tr><td>Cell 4b</td><td>Cell 5b</td><td>Cell 6b</td></tr>
</table>

头细胞1头细胞2头细胞3a
电池1A电池2A电池3a
电池4aCell 5aCell 6a
头细胞1b头细胞2b头细胞3b
1B单元2B3B单元
头细胞1头细胞2头细胞3a
电池4B电池5B电池6b
如果有人能帮助解决这个问题,请尽快告诉我。我真的很感激


提前谢谢

首先,一个表中不能有多个
标记。所以我要做的就是让每个部分都成为一个actaul表,有自己的
。现在,分页符后会显示正确的页眉

table, tr{page-break-after:auto;} 
thead {display:table-header-group;}
<table>
    <thead><tr><th>Head Cell 1a</th><th>Head Cell 2a</th><th>Head Cell 3a</th></tr></thead>
    <tr><td>Cell 1a</td><td>Cell 2a</td><td>Cell 3a</td></tr>
    <tr><td>Cell 4a</td><td>Cell 5a</td><td>Cell 6a</td></tr>   

    <thead><tr><th>Head Cell 1b</th><th>Head Cell 2b</th><th>Head Cell 3b</th></tr></thead>
    <tr><td>Cell 1b</td><td>Cell 2b</td><td>Cell 3b</td></tr>

    <!--PAGE BREAK HERE ON PRINT PREVIEW-->
    <thead><tr><th>Head Cell 1a</th><th>Head Cell 2a</th><th>Head Cell 3a</th></tr></thead>
    <tr><td>Cell 4b</td><td>Cell 5b</td><td>Cell 6b</td></tr>
</table>