Make tables scroll if they overflow.

This commit is contained in:
Rapptz 2020-06-27 07:51:17 -04:00
parent 8feb74a018
commit c69f7c7bd8
2 changed files with 12 additions and 0 deletions

View File

@ -804,6 +804,10 @@ dd {
background-color: var(--api-entry-background);
}
.table-wrapper {
overflow-x: auto;
}
table.docutils {
width: 100%;
}

View File

@ -12,6 +12,14 @@ class DPYHTML5Translator(HTML5Translator):
self.section_level -= 1
self.body.append('</section>\n')
def visit_table(self, node):
self.body.append('<div class="table-wrapper">')
super().visit_table(node)
def depart_table(self, node):
super().depart_table(node)
self.body.append('</div>')
class DPYStandaloneHTMLBuilder(StandaloneHTMLBuilder):
# This is mostly copy pasted from Sphinx.
def write_genindex(self) -> None: