-
Notifications
You must be signed in to change notification settings - Fork 181
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
merging adjacent table cells #240
Comments
I don't think this is possible until the upstream Markdown processor that |
Unfortunately the only way to accomplish this right now is to write out the table "manually" (in html) in your markdown, and use <table>
<tr>
<td colspan="2"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table> |
@vincerubinetti are you sure the HTML table method works when passing through Pandoc? My understanding is that since Pandoc's Astract Syntax Tree doesn't support colspans, if the table gets interpreted by Pandoc, this solution won't work. However, I'm not sure whether Pandoc would interpret the table or just pass-through the HTML verbatim. |
Just tested it, it does work. My understanding is that anything you write in plain HTML within a markdown file will just get passed through/ignored by pandoc. Is that consistent with your understanding? |
Good to know
I don't have a good understanding, but I think it may be dependent on which input and output formats are chosen. When going from md to html, it seems that it keeps the HTML untouched rather than interpreting it as part of the AST. |
It will pass through to the HTML output, but did you check that it also passes through to PDF and DOCX? That part I'm not sure about. |
PDF output comes right from the HTML output, so as long as WeasyPrint/Athena supports |
I think that writing the table as HTML will also break the functionality used by by @vincerubinetti thanks for checking! |
I have finally tried this out. It works, and it was not hard. I opened the built |
Nifty solution. May be kind of a pain if you have to change the table or get table numbering to work, but cool to see the workaround.
Can you paste the error text?
If Pandoc is still able to render the markdown in the HTML table cells, you could just revert the HTML citations back to the original citations. If you don't have too many citations in the table, it may just be easiest to do this manually. The |
I have one solution. The others might have different solutions. Instead of copying the html of the table into your input markdown, I'd just leave the table as regular markdown, and add the To solve this, we could create a plugin that looks for any cell that has some flag in commented-out text, say So basically you'd use markdown tables like normal, but add a little extra text to specify the | Tables | Are | Cool |
|-----------------------------|:-----------:|------:|
| col 1 <!-- colspan: 2 --> | | $1600 |
| col 2 | money | $12 |
| col 3 | money | $1 | In fact, this could be useful for more than just tables. It could be a way to bypass the issue of markdown/pandoc not being able to attach parameters to any element. It could look for any comment in the format |
This is a cool idea. Won't work for DOCX outputs (but will an HTML table in a markdown input get converted to DOCX?). @vincerubinetti happy for you to prototype this solution if you have time. If it works, we could include it as in the plugins directory (perhaps not added to the build command by default). I'm interested to see whether it works, and how general of a workaround it could be for "unsupported by pandoc" things. |
Would be nice to look for a I'm fairly certain an HTML table embedded in Markdown will not get converted to DOCX with |
Here it is: I have noticed that:
Hope this helps |
This build is based on 0dc5ea8. This commit was created by the following Travis CI build and job: https://travis-ci.com/manubot/rootstock/builds/127061386 https://travis-ci.com/manubot/rootstock/jobs/234117445 The full commit message that triggered this build is copied below: Plugin to set HTML attributes via comments Merges #251 Closes #264 Refs #240 Uses javascript to apply attributes extracted from HTML comments.
This build is based on 0dc5ea8. This commit was created by the following Travis CI build and job: https://travis-ci.com/manubot/rootstock/builds/127061386 https://travis-ci.com/manubot/rootstock/jobs/234117445 The full commit message that triggered this build is copied below: Plugin to set HTML attributes via comments Merges #251 Closes #264 Refs #240 Uses javascript to apply attributes extracted from HTML comments.
This build is based on 0dc5ea8. This commit was created by the following Travis CI build and job: https://travis-ci.com/RHagenson/biological-messaging/builds/128096845 https://travis-ci.com/RHagenson/biological-messaging/jobs/236645304 The full commit message that triggered this build is copied below: Plugin to set HTML attributes via comments Merges manubot/rootstock#251 Closes manubot/rootstock#264 Refs manubot/rootstock#240 Uses javascript to apply attributes extracted from HTML comments.
This build is based on 0dc5ea8. This commit was created by the following Travis CI build and job: https://travis-ci.com/RHagenson/biological-messaging/builds/128096845 https://travis-ci.com/RHagenson/biological-messaging/jobs/236645304 The full commit message that triggered this build is copied below: Plugin to set HTML attributes via comments Merges manubot/rootstock#251 Closes manubot/rootstock#264 Refs manubot/rootstock#240 Uses javascript to apply attributes extracted from HTML comments.
Merges manubot/rootstock#251 Closes manubot/rootstock#264 Refs manubot/rootstock#240 Uses javascript to apply attributes extracted from HTML comments.
Merges manubot/rootstock#251 Closes manubot/rootstock#264 Refs manubot/rootstock#240 Uses javascript to apply attributes extracted from HTML comments.
Hi! Is there a way to merge to (horizontally) adjacent cells in a table?
Thanks!!!
The text was updated successfully, but these errors were encountered: