-
-
Notifications
You must be signed in to change notification settings - Fork 696
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
Collapsed borders not drawn for tables in margin boxes #1278
Comments
Ok, i found why this happening, its border-collapse: collapse. I dont know if this is a bug because only shows border on first page but my problem is solved removing this param. |
Thanks a lot for taking the time to find this!
It definitely is, let’s keep this issue open. |
I think found a decent workaround for this in css. For context, I was using tables in Fomantic-UI and experienced the same issue with the columns disappearing. Haven't dug into weasyprint's code, but I'm including it in case it's helpful in diagnosing a root cause. Overriding with specific rules at the .ui.table tr {
border-collapse: collapse;
}
.ui.table th, .ui.table td {
border: 1px solid rgba(34,36,38,.15);
} |
I have the exact same problem. |
@MrUrdam I'm sorry, I don't have access to the code anymore, but I'm fairly sure that snippet was something I used to override the default styles of Fomantic-UI. You could try including it inline in your HTML... |
I already have those settings in my CSS and I get the described problem. |
Hello, thank you very much for identifying the duplicate issue, sorry for not spotting it. Grepping for "collapse" I guess "layout/table.py" is a hot candidate - but where might the combination with headers/footers come in? Or can the bug be reproduced with just normal tables (is there a minimal example)? |
Cool!
The To avoid drawing the cells’ borders, we set transparent borders instead of colored borders. That’s "the hack", it’s there: WeasyPrint/weasyprint/formatting_structure/build.py Lines 1095 to 1101 in 5c91673
For tables that are only drawn once, it’s not a problem. But for tables in page margins, it causes the bug we’re talking about. The Changing the The solution may be to remove the |
Actually, that’s not enough. The (Each time I try to solve this problem again, I rediscover why it’s more complex that it seems to be.) |
The good workaround involves using div tags instead of tables.
Divs do not use border-collapse property and do not have this problem. |
Fixed by #1884. |
I made a complex document in it and I'm putting header and footer in @ top-center and @ top-bottom. The problem is that I use a simple 1-row table. On the first page everything is ok, on the second onwards ONLY the border does not work is borderless the rest everything is ok. This only occurs in the header and footer in the rest of the document is ok
First page:
Second one:
Code:
The text was updated successfully, but these errors were encountered: