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
img width is ignored inside tables #227
Comments
What result do you expect here? What result do you obtain? Both |
Sorry, I don't think I explained well enough. In my case, I have table with a defined width (e.g.
In a web browser, it draws the image across half the screen. When rendered to pdf, the image size is unaffected. Using a fixed table size, e.g. in pixels does not change the problem. |
Ok, I see why this happens in WeasyPrint. We ignore percentages during intrinsic widths calculation, and then the table gets at least its minimum intrinsic width, even if it has a smaller specified width. Unfortunately, the spec on this subject looks wrong, and I don’t quite understand the algorithm browsers use here. This might requires some more investigation / reverse-engineering :/ |
Here's what we get in the spec now:
That's not the most precise rule I've ever seen. BTW, I've followed what this rule seems to imply (at least for width), and the result is more or less what we get in browsers. It fixes the example given in this issue and in #521, I hope that nobody relies on the old behavior (that wasn't really specified anyway). |
With html of the following form:
And css:
The width spec is ignored, and the image displays full size
The text was updated successfully, but these errors were encountered: