Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in "running" headers: table row border is only rendered for first page #1687

Closed
benboeck opened this issue Jul 17, 2022 · 1 comment
Closed

Comments

@benboeck
Copy link

benboeck commented Jul 17, 2022

Hi, thank you very much for WeasyPrint!

We are ecstatic that WeasyPrint can now do headers/footers without ugly hacks (see issue 1662)!

However, for our use case, I think I we identified a bug: though tables in "running" headers work, row borders (tr) only work on the first page.

We think this is a bug as borders work fine for paragraphs - and when specified either in the @top-center CSS or headerCenter DIV - and most importantly, it works fine on the FIRST page, but not the others.

image

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>table in header border bug</title>
        <style>
            @page  {
                size: A6 landscape;
                margin: 30mm;

                @top-center{
                    content: element(headerCenter);
                }
            }

            .headerCenter{
                position: running(headerCenter);
            }
        </style>
    </head>
    <body>
        
        <div class="headerCenter">
            <table style="border-collapse: collapse; width: 100%;">
                <tr style="border-bottom: dotted 2pt; border-bottom-color: red;">
                    <td>there should be a red dotted border below this table row - but it only works on the <b>first</b> page.</td>
                </tr>
            </table>
            <p style="border-bottom: solid 2pt; border-bottom-color: blue;">
                the blue line below this paragraph works on all pages, however.
            </p>
        </div>

        <div class="content">
            <p>&nbsp;</p>
            <p style="page-break-before:always;">&nbsp;</p>
        </div>
    </body>
</html>

expected functionality:

html content in the "runnung" header is repeated correctly for all pages, including table row (TR) borders.

@benboeck benboeck changed the title Bug in "running" headers: table border is only rendered for first page Bug in "running" headers: table row border is only rendered for first page Jul 17, 2022
@liZe
Copy link
Member

liZe commented Jul 18, 2022

Hi!

Thanks for the report. That’s actually a duplicate of #1278.

We’ve tried many times to solve this, as the problem is caused by a dirty workaround (removing cells borders to avoid them to be drawn instead of the collapsed borders) that seems easy to fix. There should be a very clean and smart way to avoid this, but … it’s not been found yet.

@liZe liZe closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants