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

No bottom cell border drawn, when table cell breaks across pages #2349

Closed
mpth opened this issue Jan 14, 2025 · 8 comments
Closed

No bottom cell border drawn, when table cell breaks across pages #2349

mpth opened this issue Jan 14, 2025 · 8 comments
Labels
CSS Questions about how to do something with CSS

Comments

@mpth
Copy link

mpth commented Jan 14, 2025

Not sure if this is just my lack of CSS knowledge but I expected a bottom border for a table cell that breaks over to the next page, especially when the table header is repeated. The screenshot below shows that now orange border is drawn at the bottom of the page.

Image

Hope the image gives enough context, happy to add a full sample if necessary.

@liZe
Copy link
Member

liZe commented Jan 14, 2025

Hi!

This is normal: when a box is split between pages, the bottom border is not drawn on the first page, and the top border is not drawn on the second page.

If you want to repeat the top/bottom borders on each page, you can set box-decoration-break: clone on your td.

@liZe liZe added the CSS Questions about how to do something with CSS label Jan 14, 2025
@mpth
Copy link
Author

mpth commented Jan 14, 2025

Thanks! I knew there was a CSS property for that but couldn't remember it.

It looks like it doesn't work in combination with table { border-collapse: collapse } though ?

@liZe
Copy link
Member

liZe commented Jan 14, 2025

It looks like it doesn't work in combination with table { border-collapse: collapse } though ?

I have no idea whether this behavior is specified. Let me check that.

@mpth
Copy link
Author

mpth commented Jan 15, 2025

Thanks for checking 👍

@JamesHutchison
Copy link

JamesHutchison commented Jan 18, 2025

Perhaps this is related - I'm seeing margin's not being applied when a div crosses the page boundary

Image

Structure would be:

<div>
  ---- page breaks here
<div>

<div>
    <div style="border: 1px solid black; height: 0; width: 100%;", class="my-4" />
<div>

<div>

<div>

@liZe
Copy link
Member

liZe commented Jan 18, 2025

I’ve checked, and as far as I can tell, it’s unfortunately not defined. The feature seems to be simple, but it’s not, as it’s easy to find corner cases where the result is far from obvious.

So, we won’t implement this feature in WeasyPrint for now.

If you’re (or anyone else is) interested in getting this feature, the next step is probably to open an issue on the CSS working group drafts repository and ask if it could be possible to define how box-decoration-break influences tables with collapsed borders.

@liZe
Copy link
Member

liZe commented Jan 18, 2025

Perhaps this is related - I'm seeing margin's not being applied when a div crosses the page boundary

@JamesHutchison It’s not related. Could you please open a new issue, with a complete example that shows your problem?

@liZe liZe closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2025
@liZe
Copy link
Member

liZe commented Jan 24, 2025

Closing, as it’s not a bug in WeasyPrint, but an undefined behavior. If someone wants to improve the specification and open an issue on the CSS working group’s repositiory, feel free to add a comment so that we can follow!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Questions about how to do something with CSS
Projects
None yet
Development

No branches or pull requests

3 participants