Enable :widths: option in table directives. by jhcole · Pull Request #795 · executablebooks/MyST-Parser
Closes #793
The output from myst-docutils-html5 differs from the results I'm getting from jupyter-book build and I'm still tracking down where the difference are coming from.
There are 4 possible states for the width option of a table directive (not set, "auto", "grid", or a list of integers).
The results from myst-docutils-html5 are as follows:
| Option | Previous behavior | New behavior |
|---|---|---|
| Not set (default) | no class or colspecs | no class or colspecs |
| auto | no class or colspecs | no class or colspecs |
| grid | no class or colspecs | Add colgroup with column widths set equal to each other. |
| a list of integers | no class or colspecs | Add colgroup with column widths set in proportion to the integers given. |
The results from jupyter-book build are as follows:
| Option | Previous behavior | New behavior |
|---|---|---|
| Not set (default) | Add the class "colwidths-auto" to the table and not set any column widths. | Set equal proportion widths to each column. This is a regression I hope to fix. |
| auto | Add the class "colwidths-auto" to the table and not set any column widths. | Add the class "colwidths-auto" to the table and not set any column widths (no change in behavior). |
| grid | Add the classes "colwidths-auto" and "colwidths-given" to the table, and not set any column widths. | Add the class "colwidths-given" to the table, and set equal widths to each column. The documentation claims this option will set widths based on column contents, but it just sets them all equal. |
| a list of integers | Add the classes "colwidths-auto" and "colwidths-given" to the table, and not set any column widths. | Add the class "colwidths-given" to the table and set columns widths in proportion to the integers given. |