From d706bcb2e2b61ee884bd40695dd4784e7c947c87 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 25 Aug 2016 14:19:26 -0400 Subject: [PATCH] Give wide tables scroll bars in readthedocs theme. The mkdocs theme doesn't need them as the entire page scrolls. Besides, to get scroll bars on the table, a narrow table won't strech across the page, which looks wierd with the table styling used in the mkdocs theme (no borders, etc.). --- mkdocs/themes/readthedocs/css/theme_extra.css | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mkdocs/themes/readthedocs/css/theme_extra.css b/mkdocs/themes/readthedocs/css/theme_extra.css index 6097fb73..f488fa79 100644 --- a/mkdocs/themes/readthedocs/css/theme_extra.css +++ b/mkdocs/themes/readthedocs/css/theme_extra.css @@ -156,3 +156,22 @@ code.cs, code.c { border: 1px solid rgba(0, 0, 0, 0.2); background: rgba(255, 255, 255, 0.7); } + +/* + * Account for wide tables which go off the side. + * Override borders to avoid wierdness on narrow tables. + * + * https://github.com/mkdocs/mkdocs/issues/834 + * https://github.com/mkdocs/mkdocs/pull/1034 + */ +.rst-content table.docutils { + width: 100%; + overflow: auto; + display: block; + border: none; +} + +td, th { + border: 1px solid #e1e4e5 !important; + border-collapse: collapse; +}