-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Word wrap does not work well in grid tables #1246
Comments
Hi @mhdirkse, unfortunately, this is not a feature that we can implement by default. Modern tables are used to display all kinds of data and this makes it exceedingly difficult to find a rule that will fit all purposes. The table primarily purpose, however, is to display tabular data, often technical data, that generally benefits from not being wrapped randomly. We must keep this in mind when defining the default tables' behaviour in a way that best fits the majority of uses. On a future major version of the theme we will try to offer more options for tables display with minimal setup. For now, the |
Thanks, Mrs. Costa. |
By default, spinx_rtd_theme sets the CSS attribute "white-space: nowrap" on table cells, which has the effect, that table contents never word-wrap and the table gets scrollable. This is unfortunate if table cells contain a large amount of text. Issue #1246 of sphinx_rtd_theme addresses this situation, but the general fix is not that easy. Until this issue is fixed upstream, introduce a custom CSS class named "word-wrap" that reverts the behaviour of table cells back to do word wrapping when the content of the cell is wider than the available width. With this change, the following example should produce a table as wide as the content area with word-wrapped text in the second row: .. table:: :class: word-wrap +--------------------------------+-----------------------------+ | Column 1 | Column 2 | +================================+=============================+ | Lorem ipsum dolor sit amet, | Duis aute irure dolor in | | adipisicing elit, sed do eius | voluptate velit esse cillum | | incididunt ut labore et dolor | fugiat nulla pariatur. | | aliqua. Ut enim ad minim veni | Excepteur sint occaecat | | nostrud exercitation ullamco | proident, sunt in culpa | | nisi ut aliquip ex ea commodi. | deserunt mollit anim id. | +--------------------------------+-----------------------------+ | Third Row | Third Row continued | +--------------------------------+-----------------------------+ Link: readthedocs/sphinx_rtd_theme#1246 Signed-off-by: Roland Hieber <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael Olbrich <[email protected]>
Problem
I had a grid table with two columns. The table became too wide because word wrap did not work properly. See question on StackOverflow. I got an answer that suggested a custom style sheet:
This fixed my issue. I would like this behavior without having to add a custom style sheet.
Reproducible Project
See https://frank-manual.readthedocs.io/en/credentials/deploying/credentials.html and https://github.com/ibissource/frank-manual/tree/credentials. This code does what I want, but only because I have a custom style sheet
custom.css
. I would like to be able to remove that file.Error Logs/Results
Place any images or error logs that might be able to help solve the issue here.
Expected Results
Please describe how this should work properly.
Environment Info
The text was updated successfully, but these errors were encountered: