mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Roland Hieber <>
Cc: Roland Hieber <>
Subject: [ptxdist] [PATCH] doc: css: allow word-wrapping in grid table cells
Date: Tue,  2 May 2023 09:55:05 +0200	[thread overview]
Message-ID: <> (raw)

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         |

Signed-off-by: Roland Hieber <>
 doc/_static/css/custom.css | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/_static/css/custom.css b/doc/_static/css/custom.css
index 0efa6f92cac5..258e8f70ebfb 100644
--- a/doc/_static/css/custom.css
+++ b/doc/_static/css/custom.css
@@ -109,3 +109,8 @@ nav.wy-nav-side #menu-resize .fa:not(:first-child) {
 .note .admonition-title {
 		background-color: #83983e !important;
+.wy-table-responsive table.word-wrap td,
+.wy-table-responsive table.word-wrap th {
+    white-space: normal;

             reply	other threads:[~2023-05-02  7:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02  7:55 Roland Hieber [this message]
2023-05-05 14:56 ` [ptxdist] [APPLIED] " Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox