Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column widths set in a table directive are ignored. #793

Open
jhcole opened this issue Jul 21, 2023 · 0 comments · May be fixed by #795
Open

Column widths set in a table directive are ignored. #793

jhcole opened this issue Jul 21, 2023 · 0 comments · May be fixed by #795
Labels
bug Something isn't working

Comments

@jhcole
Copy link
Contributor

jhcole commented Jul 21, 2023

What version of myst-parser are you using?

2.0.0

What version dependencies are you using?

$ pip list | grep -e phinx -e docu
docutils                      0.19
pydata-sphinx-theme           0.13.0rc4
Sphinx                        6.2.1
sphinx-autodoc2               0.4.2
sphinx-book-theme             1.0.0rc2
sphinx-copybutton             0.5.2
sphinx-design2                0.4.0
sphinx_pyscript               0.1.0
sphinx_pytest                 0.1.1
sphinx_tippy                  0.4.1
sphinx-togglebutton           0.3.2
sphinxcontrib-applehelp       1.0.4
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.1
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
sphinxext-opengraph           0.8.2
sphinxext-rediraffe           0.2.7

What operating system are you using?

Linux

Describe the Bug

Given this example markdown file which specified column widths, the column width information is discarded.

# example.md
```{table} *title*
:name: name
:widths: 1 2

| a | b |
|---|---|
| 1 | 2 |
```
$ myst-docutils-demo example.md 
<table id="name">
<caption><em>title</em></caption>
<thead>
<tr><th class="head"><p>a</p></th>
<th class="head"><p>b</p></th>
</tr>
</thead>
<tbody>
<tr><td><p>1</p></td>
<td><p>2</p></td>
</tr>
</tbody>
</table>

Expected Behavior

I expected the width information to be kept. For example:

$ myst-docutils-demo example.md 
<table id="name">
<caption><em>title</em></caption>
<colgroup>
<col style="width: 33.3%" />
<col style="width: 66.7%" />
</colgroup>
<thead>
<tr><th class="head"><p>a</p></th>
<th class="head"><p>b</p></th>
</tr>
</thead>
<tbody>
<tr><td><p>1</p></td>
<td><p>2</p></td>
</tr>
</tbody>
</table>

I'm currently working on a pull request which produces the expected behavior.

To Reproduce

Create this example file.

# example.md
```{table} *title*
:name: name
:widths: 1 2

| a | b |
|---|---|
| 1 | 2 |
```

Then run it like this

$ myst-docutils-demo example.md 
@jhcole jhcole added the bug Something isn't working label Jul 21, 2023
jhcole added a commit to jhcole/MyST-Parser that referenced this issue Jul 22, 2023
jhcole added a commit to jhcole/MyST-Parser that referenced this issue Jul 22, 2023
@jhcole jhcole linked a pull request Jul 23, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant