I have the following cells in a markdown table:
|Something|Something else that's rather long|Something else|
I'd like to be able to insert a break in the middle line, so the column isn't so large. How can I do that in Markdown? Do I need to use HTML tables instead?
davidsneighbour: A newline in Markdown is created by “2 spaces at the end of the line and a single newline”.
To create a line break or new line ( <br> ), end a line with two or more spaces, and then type return. This is the first line.
In summary, if you need to have a table cell span multiple lines when writing Markdown, use the HTML <br> tag, as shown.
Use an HTML line break (<br />
) to force a line break within a table cell:
|Something|Something else<br />that's rather long|Something else|
When you're exporting to HTML, using <br>
works. However, if you're using pandoc to export to LaTeX/PDF as well, you should use grid tables:
+---------------+---------------+--------------------+ | Fruit | Price | Advantages | +===============+===============+====================+ | Bananas | first line\ | first line\ | | | next line | next line | +---------------+---------------+--------------------+ | Bananas | first line\ | first line\ | | | next line | next line | +---------------+---------------+--------------------+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With