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

Tables do not render correctly #1

Closed
tjdavis3 opened this issue Jun 11, 2021 · 6 comments
Closed

Tables do not render correctly #1

tjdavis3 opened this issue Jun 11, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@tjdavis3
Copy link

tjdavis3 commented Jun 11, 2021

If the cell contents are longer than the heading length of the column then the next column will overwrite the last part of the previous column. Column widths are determined based on the values in the header row. Column contents do not wrap (at least not without changing the row height, which I have not tested).

This makes the table functionality not very useful except for the simplest of tables, which is a shame since otherwise the generated PDF looks very good.

@stephenafamo
Copy link
Owner

This should not happen.

I'll try this myself, but can you give a sample markdown that you know renders improperly?

@stephenafamo
Copy link
Owner

I'll try to fix as soon as I can, but I have quite a bit on my plate now so it may be slower than expected.

@tjdavis3
Copy link
Author

Thank you for looking into it. Here's an example .md and the corresponding pdf.

DevReport_0611.md
rpt.pdf

@stephenafamo stephenafamo added the bug Something isn't working label Aug 18, 2022
@erwin
Copy link

erwin commented Nov 24, 2022

@stephenafamo

Have you had a chance to get implement any table support so far? If there is some amount of table support that we can work within the parameters of, that would be good to know.

I tried adding fixed width spacing to @tjdavis3's example to see if it would work, but for me, the table was still not formatted the way I would expect in the output PDF...

| project                        | Status      | Due         | Stories | Completed | % Completed |
| ------------------------------ | ----------- | ----------- | ------- | --------- | ----------- |
| Document System                | in progress | 06-29-2021  |       25|         11|         44% |
| Message-based APIs             | in progress | 06-25-2021  |       11|          7|         63% |
| Inventory MVP                  | in progress | 07-01-2021  |       78|         67|         85% |
| Company Master GP Sync Service | in progress | 07-02-2021  |        6|          0|          0% |
| Data Warehouse                 | in progress | 07-04-2021  |       28|         17|         60% |

For some reason it's getting parsed as text rather than as a table. I see this in the log:

-[Text] Projects Health
-[Heading (leaving)]
[Paragraph (entering)]
[... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7
[Text] | project                        | Status      | Due         | Stories | Completed | % Completed |
[Text] | ------------------------------ | ----------- | ----------- | ------- | --------- | ----------- |
[Text] | Document System                | in progress | 06-29-2021  |       25|         11|         44% |
[Text] | Message-based APIs             | in progress | 06-25-2021  |       11|          7|         63% |
[Text] | Inventory MVP                  | in progress | 07-01-2021  |       78|         67|         85% |
[Text] | Company Master GP Sync Service | in progress | 07-02-2021  |        6|          0|          0% |
[Text] | Data Warehouse                 | in progress | 07-04-2021  |       28|         17|         60% |
[Paragraph (leaving)]
[... Margins (left, top, right, bottom:] 28.35 28.35 28.35 56.7

Output PDF looks like:

image

@ivanjaros
Copy link

You need to enable the goldmark extension.GFM or extension.Table. goldmark.WithExtensions(extension.GFM).

@stephenafamo
Copy link
Owner

@tjdavis3 & @erwin let me know if @ivanjaros's suggestion fixed the issue or not.

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

No branches or pull requests

4 participants