From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 02 May 2023 09:55:31 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ptkrE-002877-6k for lore@lore.pengutronix.de; Tue, 02 May 2023 09:55:31 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1ptkrC-0004wb-D8; Tue, 02 May 2023 09:55:30 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ptkqv-0004vg-0O; Tue, 02 May 2023 09:55:13 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1ptkqu-000XVp-HN; Tue, 02 May 2023 09:55:12 +0200 Received: from rhi by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1ptkqt-001KWB-On; Tue, 02 May 2023 09:55:11 +0200 From: Roland Hieber To: ptxdist@pengutronix.de Date: Tue, 2 May 2023 09:55:05 +0200 Message-Id: <20230502075505.316900-1-rhi@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Mail-Followup-To: Roland Hieber , ptxdist@pengutronix.de Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH] doc: css: allow word-wrapping in grid table cells X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Roland Hieber Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false 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: https://github.com/readthedocs/sphinx_rtd_theme/issues/1246 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; +} -- 2.39.2