Open
Description
Problem
When using the sphinx_rtd_theme
, text does not wrap in RST .. list-table::
cells like it does with the default Sphinx HTML theme. For example, the default Sphinx HTML builder theme renders like this:

(FWIW: the LaTeX and text Sphinx builders also render with wrapped text in the cell)
But the sphinx_rtd_theme
renders the same RST like this:

The HTML difference between the two appears to be that the sphinx_rtd_theme
has this set:
.wy-table-responsive table td, .wy-table-responsive table th {
white-space: nowrap;
white-space-collapse: collapse;
text-wrap: nowrap;
}
Reproducible Project
conf.py
:
html_theme = 'sphinx_rtd_theme'
index.rst
:
Hello world.
.. list-table::
:header-rows: 1
:widths: 10 25
* - Col 1
- Col 2
* - Content
- This is a long sentence that should wrap nicely in the rendered
table, but just to make sure, we'll make it super, extra,
incredibly long.
Error Logs/Results
$ rm -rf _build && sphinx-build -M html . _build
Running Sphinx v6.2.1
making output directory... done
building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.
The HTML pages are in _build/html.
Expected Results
I expect the words to wrap in the cell, like they do with the default Sphinx HTML builder theme, and with other Sphinx builders.
Environment Info
- Python Version: 3.11.4
- Sphinx Version: 6.2.1
- RTD Theme Version: same results with 1.3.0rc1 and 1.2.2 (didn't manually test back further). This behavior has been around for a long time; I didn't realize that other Sphinx themes / builders wrapped words in a cell until very recently (which is why I didn't file this issue until now).