diff --git a/docs/changelog.rst b/docs/changelog.rst index 7c76a38..7c45193 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,7 @@ Changelog Unreleased ---------- +* **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 e1e8e1f..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; @@ -32,6 +37,9 @@ table.docutils { tbody { tr { + page-break-inside: avoid; + break-inside: avoid-page; + &.row-odd { background: #f6f6f6; }