Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History
203 lines (198 loc) · 5.77 KB

File metadata and controls

203 lines (198 loc) · 5.77 KB
title Ordered Lists
syntax-id ordered-lists
syntax-summary 1. First item 2. Second item 3. Third item
description To create an ordered list, add line items with numbers followed by periods. The numbers don't have to be in numerical order, but the list should start with the number one.
examples
markdown html
1. First item 2. Second item 3. Third item 4. Fourth item
<ol><li>First item</li><li>Second item</li><li>Third item</li><li>Fourth item</li></ol>
markdown html
1. First item 1. Second item 1. Third item 1. Fourth item
<ol><li>First item</li><li>Second item</li><li>Third item</li><li>Fourth item</li></ol>
markdown html
1. First item 8. Second item 3. Third item 5. Fourth item
<ol><li>First item</li><li>Second item</li><li>Third item</li><li>Fourth item</li></ol>
markdown html
1. First item 2. Second item 3. Third item 1. Indented item 2. Indented item 4. Fourth item
<ol><li>First item</li><li>Second item</li><li>Third item<ol><li>Indented item</li><li>Indented item</li></ol></li><li>Fourth item</li></ol>

To create an ordered list, add line items with numbers followed by periods. The numbers don't have to be in numerical order, but the list should start with the number one.

Markdown HTML Rendered Output
1. First item
2. Second item
3. Third item
4. Fourth item
<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
  <li>Fourth item</li>
</ol>
  1. First item
  2. Second item
  3. Third item
  4. Fourth item
1. First item
1. Second item
1. Third item
1. Fourth item
<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
  <li>Fourth item</li>
</ol>
  1. First item
  2. Second item
  3. Third item
  4. Fourth item
1. First item
8. Second item
3. Third item
5. Fourth item
<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
  <li>Fourth item</li>
</ol>
  1. First item
  2. Second item
  3. Third item
  4. Fourth item
1. First item
2. Second item
3. Third item
    1. Indented item
    2. Indented item
4. Fourth item
<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item
    <ol>
      <li>Indented item</li>
      <li>Indented item</li>
    </ol>
  </li>
  <li>Fourth item</li>
</ol>
  1. First item
  2. Second item
  3. Third item
    1. Indented item
    2. Indented item
  4. Fourth item

Ordered List Best Practices

CommonMark and a few other lightweight markup languages let you use a parenthesis ()) as a delimiter (e.g., 1) First item), but not all Markdown applications support this, so it isn’t a great option from a compatibility perspective. For compatibility, use periods only.

✅  Do this ❌  Don't do this
1. First item
2. Second item
1) First item
2) Second item