Grid table 不自动换行

Grid table does not word-wrap

这是一个关于 Sphinx 和阅读文档的问题。我有如下所示的网格 table。任何人都可以帮助我,因为它不自动换行吗? table 变得比屏幕宽度宽得多,并且它有一个水平滚动条。我希望 table 适合我的屏幕。

+-------------------------------------------------------------+-----------------------------------------------------+
| Credentials factory and extra properties                    | Explanation                                         |
+=============================================================+=====================================================+
| ``nl.nn.credentialprovider.PropertyFileCredentialFactory``  | Credentials from properties file.                   |
|   with ``credentialFactory.map.properties``                 |   ``credentialFactory.map.properties`` holds the    |
|                                                             |   name of the file with usernames and passwords.    |
|                                                             |   See above example for file contents.              |
+-------------------------------------------------------------+-----------------------------------------------------+
| ``nl.nn.credentialprovider.FileSystemCredentialFactory``    | Username and password in separate text files.       |
|   with ``credentialFactory.filesystem.usernamefile``,       |   The properties are names of files holding the     |
|   ``credentialFactory.filesystem.passwordfile`` and         |   username and the password. The paths in           |
|   ``credentialFactory.filesystem.root``. Default values     |   ``credentialFactory.filesystem.usernamefile``     |
|   ``username``, ``password`` and ``/etc/secrets``.          |   and ``credentialFactory.filesystem.passwordfile`` |
|                                                             |   are relative to the path in                       |
|                                                             |   ``credentialFactory.filesystem.root``.            |
+-------------------------------------------------------------+-----------------------------------------------------+
| ``nl.nn.credentialprovider.AnsibleVaultCredentialFactory``  | Credentials in Ansible vault. The extra             |
|   with ``credentialFactory.ansibleVault.vaultFile`` and     |   properties hold the vault file and the key file.  |
|   ``credentialFactory.keyFile``.                            |                                                     |
+-------------------------------------------------------------+-----------------------------------------------------+
| ``nl.nn.credentialprovider.WebSphereCredentialFactory``,    | Credentials configured in Websphere Application     |
|   no additional properties.                                 |   Server.                                           |
+-------------------------------------------------------------+-----------------------------------------------------+

在我写这篇文章的时候,你可以在 https://frank-manual.readthedocs.io/en/credentials/deploying/credentials.html 看到呈现的 table。我打算至少在 2021 年 10 月 5 日星期二之前保持在线状态。包含 nl.nn.credentialprovider.FileSystemCredentialFactory 的单元格似乎是罪魁祸首。

我有 Sphinx 版本 4.0.0 和 sphinx-rtd-theme 版本 0.5.2

谨致问候,

马丁·德克塞

您需要使用自定义样式覆盖默认样式 sheet。

来自Adding Custom CSS or JavaScript to Sphinx Documentation

If your custom stylesheet is _static/css/custom.css, you can add that CSS file to the documentation using the Sphinx option html_css_files:

conf.py

# These folders are copied to the documentation's HTML output
html_static_path = ['_static']

# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = [
    'css/custom.css',
]

css/custom.css

.wy-table-responsive table td, .wy-table-responsive table th {
    white-space: inherit;
}