Change table cell background color in Sphinx HTML output

Viewed 28

I'd like to simply customize my Sphinx theme so that all tables (no matter which type of table they are) have cells that are one solid color. Right now, creating a table defaults to alternating between white and grey for the table cell colors as seen in the attached image. I don't see anything specific to tables in my CSS file. Thanks in advance.

Default tables in Sphinx

Created tables and received default behavior shown in image above.

1 Answers

One way is to use inline HTML and add CSS classes to your table. This will also give you more formatting control over the table.

.. html::

    <table class="table table-my-special-table">
       ...

Related