Closed kdeldycke closed 3 years ago
Here is a table in MyST:
| Column | Left-aligned | Centered | Right-aligned | |--------|:-------------|:--------:|--------------:| | 1 | 2 | 3 | 4 | | A | B | C | D |
I expect the content of the first and second column to be left-aligned, the third column to be centered and the last one to be right aligned.
Unfortunately all cells ends up left-aligned.
Here is the HTML produced for a row:
<tr class="row-odd"> <td> <p>A</p> </td> <td class="text-align:left"> <p>B</p> </td> <td class="text-align:center"> <p>C</p> </td> <td class="text-align:right"> <p>D</p> </td> </tr>
See how the alignment gets hard-coded in the form of a class attribute? This seems to be fixed if I manually edit each <td> tag and replace class= by style=.
<td>
class=
style=
✓
Here I expect the contant of each column to respect the alignment constraint defined in Markdown between the header of the table and its rows.
This sounds like a bug to file against myst-parser.
/cc @choldgraf
What's happening?
Here is a table in MyST:
I expect the content of the first and second column to be left-aligned, the third column to be centered and the last one to be right aligned.
Unfortunately all cells ends up left-aligned.
Here is the HTML produced for a row:
See how the alignment gets hard-coded in the form of a class attribute? This seems to be fixed if I manually edit each
<td>
tag and replaceclass=
bystyle=
.Reproducer
✓
in the table are left-aligned.✓
are constrained to be centered.Expectation
Here I expect the contant of each column to respect the alignment constraint defined in Markdown between the header of the table and its rows.
Code of Conduct