首页 > 解决方案 > 狮身人面像中的左对齐表格标题

问题描述

有没有办法在 Sphinx 输出中左对齐表格标题(使用 sphinx_rtd_theme)?

自定义 css 包含在 conf.py 中:

def setup(app):
    app.add_stylesheet('_static/custom.css')

这是有效的:

.wy-nav-content {
     max-width: none;
 }

这些都不起作用:

.caption {
     align:left
 }    

或者

.caption-text {
     align:left
 }    

是否可以通过自定义css?

标签: csspython-sphinxread-the-docs

解决方案


使用正确的 CSS 语法来对齐文本:

.caption-text {
    text-align: left;
}

推荐阅读