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

4.7k views Asked by At

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

There are 1 answers

0
mbb On BEST ANSWER

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;
}