Search code examples
csspython-sphinxread-the-docs

Left-aligned table caption in sphinx


Is there a way to left-align table captions in Sphinx output (using sphinx_rtd_theme)?

Custom css is included in conf.py:

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

This is working:

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

Neither of these work:

.caption {
     align:left
 }    

or

.caption-text {
     align:left
 }    

Is it possible via custom css?


Solution

  • Use correct CSS syntax for aligning text:

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