Ordered lists are a fundamental feature in Markdown, allowing you to create numbered sequences of items. They're perfect for step-by-step instructions, prioritized tasks, or any content that requires a specific order.
Creating an ordered list in Markdown is straightforward. Simply start each line with a number followed by a period and a space. The actual numbers don't matter; Markdown will automatically number the list correctly.
1. First item
2. Second item
3. Third item
This will render as:
Markdown is flexible with numbering. You can use any number to start your list, and the subsequent items will follow in order. This is particularly useful when editing long lists.
1. First item
1. Second item
1. Third item
Or even:
3. First item
5. Second item
9. Third item
Both examples will render the same as the first example.
You can create nested ordered lists by indenting the sub-items. This is useful for creating hierarchical structures or sub-steps within a main list.
1. First main item
1. Sub-item one
2. Sub-item two
2. Second main item
3. Third main item
This creates a nested structure:
Ordered lists can be combined with other Markdown elements. For instance, you can use bold and italic text within list items or even include code blocks.
1. **Bold item**
2. *Italic item*
3. Item with `inline code`
4. Item with a code block:
```python
print("Hello, World!")
```
Ordered lists in Markdown provide a simple yet powerful way to structure numbered content. They're essential for creating clear, organized documents, especially when combined with unordered lists and other Markdown features. Practice using ordered lists to enhance the readability and structure of your Markdown documents.