You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I tried to convert html table to markdown table, but I can't get correct result:
<tableborder="1" id="tableWithOutHeadAndBody"><caption>table Without Head And Body</caption><tr><th>Month</th><th>Savings</th></tr><tr><td>January</td><td>$100</td></tr></table>
<tableborder="1" id="tableWithHeadAndBody"><caption>table With Head And Body</caption><thead><tr><th>Month</th><th>Savings</th></tr></thead><tbody><tr><td>January</td><td>100</td></tr><tr><td>February</td><td>80</td></tr></tbody></table>
so, if i want to convert html table element to markdown table, the thead and the tbody element is needed?
if so, may be add a explain on docs is helpful.... I tried a lot of time to read docs and serach....
anyway, thanks for the excellent work on showdown!
<!DOCTYPE html><htmllang="zh-cn"><head><metacharset="UTF-8"><title>Test showdown table convert</title></head><body><tableborder="1" id="tableWithHeadAndBody"><caption>table With Head And Body</caption><thead><tr><th>Month</th><th>Savings</th></tr></thead><tbody><tr><td>January</td><td>100</td></tr><tr><td>February</td><td>80</td></tr></tbody></table><buttonid="btn" >click me to convert table to markdown and log</button><hr><tableborder="1" id="tableWithOutHeadAndBody"><caption>table Without Head And Body</caption><tr><th>Month</th><th>Savings</th></tr><tr><td>January</td><td>$100</td></tr></table><buttonid="btn2" >click me to convert table to markdown and log</button><scriptsrc="./showdown.min.js"></script><script>varconverter=newshowdown.Converter({tables: true})varresultvarbtn=document.getElementById('btn')btn.addEventListener('click',function(){result=converter.makeMarkdown(document.getElementById("tableWithHeadAndBody").outerHTML)console.log(result)})varbtn2=document.getElementById('btn2')btn2.addEventListener('click',function(){result=converter.makeMarkdown(document.getElementById("tableWithOutHeadAndBody").outerHTML)console.log(result)})</script></body></html>
The text was updated successfully, but these errors were encountered:
Hi, I tried to convert html table to markdown table, but I can't get correct result:
and the result is:
| |
| |
| |
| |
I read the docs, add a option, it still not work
var converter = new showdown.Converter({ tables: true })
[Available options - Showdown documentation](https://showdownjs.com/docs/available-options/#tables)
and then I search the issue, and find somebody add thead and tbody element [Bug] in table align right · Issue #689 · showdownjs/showdown
so I tried it ,it works:
result is :
envirement:
browser: chrome 103.0.5060.66 (64 bit) (cohort: Stable)
showdown: 2.1.0 https://unpkg.com/[email protected]/dist/showdown.min.js
so, if i want to convert html table element to markdown table, the thead and the tbody element is needed?
if so, may be add a explain on docs is helpful.... I tried a lot of time to read docs and serach....
anyway, thanks for the excellent work on showdown!
complete code : https://github.com/Peter-JXL/learnturndown/blob/master/src/testShowdown/testShowdown.html
The text was updated successfully, but these errors were encountered: