Lessons

Lesson 4 - Lists, Quotes, and Tables

water droplets on grass

Lists

Unordered lists

Unordered lists can be created with dashes or asterisks. With dashes:

  • this is an item
  • this is another item

With asterisks:

  • this is an item
  • this is another item

Ordered lists

Ordered (numbered) lists can be created with (surprise!) numbers. You can write numbers as you would normally, or you can just write the number 1 over and over, like so:

  1. this is item 1
  2. despite being written with a 1, this is item 2

This allows you to insert more information into lists in the future without having to renumber every following item.

Nested lists

Both unordered and ordered lists can be nested. Just tab the nested section inwards:

  • this is an item
    • this is nested below it
    • this is also nested
  • this is another item

You can mix unordered and ordered lists when you nest.

Quotes

You can always just use quotation marks, of course, but if you are quoting a larger chunk of text it can be nice to use a blockquote.

You format a blockquote by starting the line with a caret:

This is a quote, and it will render differently than a paragraph.

If you want a quote to have multiple separate paragraphs, and still contiguously display as one quote, make sure to put a caret on the empty line between the paragraphs.

This is a multi-paragraph quote.

Here's the second paragraph.

Tables

Tables in Markdown are kind of annoying to format. You use the pipe (|) character as well as dashes.

First, there is a header row. I'm using a monospace block here because a malformed table won't render correctly.

| Header 1 | Header 2 |

Below the header row is a row that separates the headers from the data. Note that the dashes don't need to be the same length as the header text - they just need to be at least 3 dashes.

| Header 1 | Header 2 |
|---|---|

Finally, you can add the data:

| Header 1 | Header 2 |
|---|---|
| data 1a | data 1b |
| data 2a | data 2b |
| data 3a | data 3b |

When I remove the monospace block, you can see how this formats:

Header 1 Header 2
data 1a data 1b
data 2a data 2b
data 3a data 3b