Skip to content

Follow new guidelines to repeat table headers/footers #2679

@dami54

Description

@dami54

Hello,

I am trying to add a break-inside: avoid; inside my tbody.tr to only fit correctly inside the table. But when the text is too big, the thead is not displaying.

I am using the last version 68.1, any idea how to fix it please? Thanks in advance,

Image
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Test PDF</title>
    <style>
        @page {
            size: A4 landscape;
            margin: 1.5cm 1cm;
        }

        table {
            border: 1px solid black;
            width: 100%;
            border-collapse: collapse;
        }

        table, th, td {
            border: 1px solid black;
        }
    </style>
</head>
<body>
    <table>
        <thead>
            <tr>
                <th>Column 1</th>
                <th>Column 2</th>
            </tr>
            <tr>
                <th>Subheader 1</th>
                <th>Subheader 2</th>
            </tr>
        </thead>
        <tbody>
            <tr style="break-inside: avoid;">
                <td>Row 1, Column 1</td>
                <td>
                    long text that might wrap or extend beyond the usual length
                    <span style="display: block; margin-top: 700px;">Additional line to test multi-line content in the cell.</span>
                </td>
            </tr>
            <tr>
                <td>Row 2, Column 1</td>
                <td>
                    small text
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature that should be supported

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions