Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 349
k0ss Avatar asked Jun 12 '15 20:06

k0ss


1 Answers

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:

example 1

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

example 2

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;
}
like image 151
mbb Avatar answered Oct 12 '22 00:10

mbb