Reputation: 296
I am using sphinx to transform my rst files into jsons with html, and in my rst file I define table without the widths like so:
list-table::
:header-rows: 1
* - Option A
- Item B
- Item C
* - Option B
- Item D
- Item E
In the resulting html when we were using sphinx 4.3.1 we had a colgroup tag defining the widths of the table, to be of equal size. Now after upgrading to sphinx 7.0.1 we no longer have the colgroup tag appearing in the html structure and our tables are broken. Why was this removed from sphinx? Was this default tables being of equal width functionality removed on purpose? I didn't find any mention of that in the changelog in the official sphinx site. What would be the best approach to fix this issue?
Upvotes: 0
Views: 132
Reputation: 51012
The problem is caused by a change in Docutils 0.18. From the release notes:
Make "auto" table column widths the default: Only specify column widths, if the "widths" option is set and not "auto". The table-style setting "colwidths-grid" restores the current default.
To keep the old behaviour, add a docutils.conf file in the configuration directory of your Sphinx project, with the following content:
[html writers]
table-style: colwidths-grid
Upvotes: 4