From 983fce52fb2780f2b414ffbaec7e807b7a8015b2 Mon Sep 17 00:00:00 2001 From: Jared Dillard Date: Mon, 6 Jul 2026 12:35:30 -0700 Subject: [PATCH 1/2] Prevent table rows from splitting across pages --- docs/changelog.rst | 1 + .../themes/simplepdf_theme/static/styles/sources/_tables.scss | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7c76a38..5b2ff70 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,7 @@ Changelog Unreleased ---------- +* **Bugfix**: [#155] Prevent table rows from splitting across pages. * **Bugfix** [#134] Improve support for external theme packages by using a ``get_scss_sources_path()`` convention. - If needed, theme warnings can be suppressed via ``suppress_warnings = ["simplepdf.theme"]``. diff --git a/sphinx_simplepdf/themes/simplepdf_theme/static/styles/sources/_tables.scss b/sphinx_simplepdf/themes/simplepdf_theme/static/styles/sources/_tables.scss index e1e8e1f..90cd46c 100644 --- a/sphinx_simplepdf/themes/simplepdf_theme/static/styles/sources/_tables.scss +++ b/sphinx_simplepdf/themes/simplepdf_theme/static/styles/sources/_tables.scss @@ -32,6 +32,9 @@ table.docutils { tbody { tr { + page-break-inside: avoid; + break-inside: avoid-page; + &.row-odd { background: #f6f6f6; } From faa3f136a930407f1fb034727009540b580d147f Mon Sep 17 00:00:00 2001 From: Jared Dillard Date: Wed, 8 Jul 2026 13:38:19 -0700 Subject: [PATCH 2/2] Avoid page breaks after table captions --- docs/changelog.rst | 2 +- .../simplepdf_theme/static/styles/sources/_tables.scss | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 5b2ff70..7c45193 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,7 +4,7 @@ Changelog Unreleased ---------- -* **Bugfix**: [#155] Prevent table rows from splitting across pages. +* **Bugfix**: [#155] Prevent table rows from splitting across pages and table captions from separating from their tables. * **Bugfix** [#134] Improve support for external theme packages by using a ``get_scss_sources_path()`` convention. - If needed, theme warnings can be suppressed via ``suppress_warnings = ["simplepdf.theme"]``. diff --git a/sphinx_simplepdf/themes/simplepdf_theme/static/styles/sources/_tables.scss b/sphinx_simplepdf/themes/simplepdf_theme/static/styles/sources/_tables.scss index 90cd46c..8d95a77 100644 --- a/sphinx_simplepdf/themes/simplepdf_theme/static/styles/sources/_tables.scss +++ b/sphinx_simplepdf/themes/simplepdf_theme/static/styles/sources/_tables.scss @@ -16,6 +16,11 @@ table.docutils { background-color: transparent; border-spacing: 0; + caption { + page-break-after: avoid; + break-after: avoid-page; + } + td, th { padding: .75rem; vertical-align: top;