Search code examples
markdown

How do I add a newline in a markdown table?


I have the following cells in a markdown table:

something something that's rather long and goes on for a very long time something else

I'd like to be able to insert a break in the middle line, so the middle column isn't so wide. How can I do that in Markdown? Do I need to use HTML tables instead?


Solution

  • Use an HTML line break (<br>) to force a line break within a table cell:

    | something | something that's rather long and <br>goes on for a very long time | something else |
    |-----------|---------------------------------------------------------------|----------------|
    

    Rendered:

    something something that's rather long and
    goes on for a very long time
    something else