Open kreuzberger opened 1 year ago
Fixing the issue with #weasyprint-541 has issues with default layouting of tables. Instead could #weasyprint-1520 be used with overflow-wrap: anywhere to fix the issue.
The demo pdf is then changed in layout, currently not clear what else could be influenced.
in _table.scss add overflow-wrap: anywhere;
to table.docutils { td, th {
section
The affected sections in the demo pdf are the table output in "Giant Tables". Withoud modification these are also printed not completly in the pdf, but after the patch completly with very small columns.
Maybe its best to add a "class" to hande this behaviour and then use this in table directies to enable/disable default overlap handling.
Thanks for the analysis. I think there is not one solution to solve all possible table problems.
And a good solution would be to provide 1-2 classes, which deal differently with it. By default, I would not change any font or column space sizes. It's up to the user to provide PDF-compatible content or to select the needed representation by setting the suitable class.
we came to the same solution :-) Provided a PR with an extra class for table wrapping. "Motivation" from my issue came from imported needs requirements, shown in an overview (database tables) and in a complete list of requirements. Due to the imported nature there is no chance to get "breakable" words in the specifications, e.g for "file naming conventions" or url handlings
What is the final fix for this @danwos. I also see the table column overflow to the right if it has more than 3 columns.
If i have non-breakable content in my tables (e.g. in Tables from sphinx-needs specifications) or in RestructuredText Tables directly, the tables are rendered in html fine by adding scroolbars (e.g. to datatables styles in needs-table) or in html directly.
In the pdf output the table is extend over the right margins and page, also ignoring any colwidths hints.
What is the default strategy for this?
Attached is a patch to get to the issue by adding "Non-breakable" content to the demo files sphinx-simplepdf_long_text_breaks.txt
This may be affected also to weasyprint issues regarding table layouts itself, see #weasyprint-541