如何在tr-> p-dataTable PrimeNG上勒索分页后/之前?

时间:2018-09-11 08:02:44

标签: javascript angular typescript primeng primeng-datatable

我需要勒索p-dataTable中<tr>上的分页事件。如果我可以控制在哪一行上可以做到这一点,那就太好了。

我使用以下方法在普通表上得到结果:

@media print {
    tr {
        display: block;
        width: 100%;
        page-break-after: always;
        page-break-inside: avoid;
        page-break-before: avoid;
    }
}


<table style="width: 100%;">
    <thead>
        <tr>
            <th>Head 1</th>
            <th>Head 2</th>
            <th>Head 3</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Row 1 Cell 1</td>
            <td>Row 1 Cell 2</td>
            <td>Row 1 Cell 3</td>
        </tr>
        <tr>
            <td>Row 2 Cell 1</td>
            <td>Row 2 Cell 2</td>
            <td>Row 2 Cell 3</td>
        </tr>
            <tr>
            <td>Row 3 Cell 1</td>
            <td>Row 3 Cell 2</td>
            <td>Row 3 Cell 3</td>
        </tr>
    </tbody>
</table>

如何在p-dataTable上获得此结果?

更新

下面的这段代码允许勒索分页符

::ng-deep tr {
        display: block !important;
        width: 100%;
        page-break-after: always !important;
        page-break-inside: avoid !important;
        page-break-before: avoid !important;
    }

问题是如何在选定的<tr>

中强制使用它

0 个答案:

没有答案
相关问题