Enable :widths: option in table directives.#795
Enable :widths: option in table directives.#795jhcole wants to merge 1 commit intoexecutablebooks:masterfrom
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #795 +/- ##
==========================================
- Coverage 90.26% 90.26% -0.01%
==========================================
Files 23 23
Lines 2970 2969 -1
==========================================
- Hits 2681 2680 -1
Misses 289 289
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
To note, this shouldn't have anything to do with jupyter-book, since jupyter-book is just a thin wrapper on top of sphinx+myst-parser, that does not change its behaviour This is the code for the table directive: https://github.com/live-clones/docutils/blob/6de53a0de5415174d58e775110d89e13dd76fc83/docutils/docutils/parsers/rst/directives/tables.py#L134 This is where it used in the HTML conversion: https://github.com/live-clones/docutils/blob/6de53a0de5415174d58e775110d89e13dd76fc83/docutils/docutils/writers/_html_base.py#L686 |
|
Hi, I saw the linked issue and was wondering if there was a roadmap to have this PR get merged into a release? Thanks! |
Sorry, I haven't had time to finish this. It will likely be a few months before I have time to focus on it again. You're welcome to take it over. |
|
It works In my sphinx, If one just only change the code in i.e., delete or comment the line 1352: |
|
@chrisjsewell Too bad this issue isn't fixed :) It may be useful to note that the # With `{list-table}`
:::{list-table}
:widths: 30 30 30
:header-rows: 1
* - Header 1
- Header 2
- Header 3
* - Cell 1-1
- Cell 1-2
- Cell 1-3
* - Cell 2-1
- Cell 2-2
- Cell 2-3 long long long long long long long
:::
# With `{table}`
:::{table}
:width: 100
:widths: 30 30 30
| Header 1 | Header 2 | Header 3 |
|----------|----------|---------------------------------------------|
| Cell 1-1 | Cell 1-2 | Cell 1-3 |
| Cell 2-1 | Cell 2-2 | Cell 2-3 long long long long long long long |
::: |
|
Any update on this issue? |
Closes #793
The output from
myst-docutils-html5differs from the results I'm getting fromjupyter-book buildand 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-html5are as follows:The results from
jupyter-book buildare as follows: