Can I word-wrap long columns in GitHub-compatible Markdown?

烂漫一生 提交于 2020-01-12 20:59:12

问题


I am writing a GitHub issue/wiki page which contains a table where one of the columns is quite large for many of the entries. Is there any way to wrap long columns in a table in GitHub-compatible markdown?

Example:

| Regular Column | Long Column |

| -------------- | ----------- |

| Small amount | So much stuff that it makes it so that I have to scroll which is really bad for quick readability. |

I would like to make it so that the content of "Long Column" is automatically wrapped so that people can skim the contents without having to scroll way over to the right to see all of the contents.


回答1:


It's not a markdown feature since markdown doesn't result in a rendered view. The app that's rendering your markdown is what's in charge of spacing. For example, I used your exact file in a GH repo and it looks good:

I then added even more text to see if it gets ugly. It still looks good:

The way GitHub renders the site makes it pretty. Whatever app you're viewing it in needs to implement something similar, that may look like this CSS:

div {
    width: 200px;
    word-wrap: break-word;
}


来源:https://stackoverflow.com/questions/30811491/can-i-word-wrap-long-columns-in-github-compatible-markdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!