-
-
Notifications
You must be signed in to change notification settings - Fork 710
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
Unable to set table column width on tables td's if a th exists #172
Comments
I wouldn’t be surprised if we do colspan wrong in the automatic column width algorithm. @liZe does that ring a bell? |
I think that percentages are not handled at all when no width is set to the table, even without colspans. I'll check that. |
http://dbaron.org/css/intrinsic/ describes algorithms we could implement to handle this kind of thing. At the moment, it’s the closest thing in existence to a spec of what browsers do. |
Soooooo easyyyyyyyy! |
Of course. It’s just a small matter of programming :) |
Apologies, I should have clarified that even with a table width of 100% and table-layout of fixed this still happens, but from what you've written in response it seems like you're onto it anyway. :) |
This is still a real pain. Any fix available? I have a table with 6 columns, and each column has a width set, which looks great in Chrome, but with weasyprint, these widths are ignored, and all columns seem to be equally distributed 😦 |
I don't think anyone is working on Weasy anymore. The hacky workaround I use is just to have an invisible th row above the normal one, and hide all the margins, padding, borders, etc, then just set the widths on that. It's bad code, but it's what you have to do to get it working in Weasy :( |
You can look at #291. Your specific case is maybe the worst case for this algorithm (the width of the table is a too high, it's the same rendering as Chrome for example), but at least it takes care of the percentages. It's much better for other cases. Feel free to tests and reports bugs! |
@eldamir @stevenlaidlaw last call for tests! You can try #291 if you want. |
@eldamir @stevenlaidlaw it's merged in master. |
Version 0.26 ------------ Released on 2016-01-29. New features: * Support the `empty-cells` attribute. * Respect table, column and cell widths. Bug fixes: * `#172: <https://github.com/Kozea/WeasyPrint/issues/172>`_: Unable to set table column width on tables td's. * `#151: <https://github.com/Kozea/WeasyPrint/issues/151>`_: Table background colour bleeds beyond table cell boundaries. * `#260: <https://github.com/Kozea/WeasyPrint/issues/260>`_: TypeError: unsupported operand type(s) for +: 'float' and 'str'. * `#288: <https://github.com/Kozea/WeasyPrint/issues/288>`_: Unwanted line-breaks in bold text. * `#286: <https://github.com/Kozea/WeasyPrint/issues/286>`_: AttributeError: 'Namespace' object has no attribute 'attachments'.
If a 'table > thead > tr > th' is set, weasy is not able to set the column widths on td's below it. This is a problem when trying to set widths on table columns where the table header has a colspan greater than 1.
Example:
The text was updated successfully, but these errors were encountered: