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

Overflow wrapping of content in, e.g. in tables #34

Open
kreuzberger opened this issue Sep 19, 2022 · 5 comments
Open

Overflow wrapping of content in, e.g. in tables #34

kreuzberger opened this issue Sep 19, 2022 · 5 comments

Comments

@kreuzberger
Copy link
Contributor

kreuzberger commented Sep 19, 2022

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?

  • Adding a overflow-x to css to avoid this (auto, hidden or what)
  • Adding overflow-wrap (overflow-wrap to tables and/or to what else)?
  • Should this configurable (e.g. by class? oder via simplepdf-variables?

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

@kreuzberger
Copy link
Contributor Author

kreuzberger commented Sep 19, 2022

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

@kreuzberger
Copy link
Contributor Author

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.

kreuzberger added a commit to procitec/sphinx-simplepdf that referenced this issue Sep 19, 2022
@danwos
Copy link
Member

danwos commented Sep 19, 2022

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.

@kreuzberger
Copy link
Contributor Author

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

kreuzberger added a commit to procitec/sphinx-simplepdf that referenced this issue Sep 19, 2022
kreuzberger added a commit to procitec/sphinx-simplepdf that referenced this issue Sep 19, 2022
kreuzberger added a commit to procitec/sphinx-simplepdf that referenced this issue Sep 20, 2022
danwos added a commit that referenced this issue Sep 21, 2022
[#34] fix overlap content in tables with extra class option
@sachin-suresh-rapyuta
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants