Fundamentals 6 min read

Master Markdown: A Complete Guide to Headings, Lists, Tables, and Code Blocks

This tutorial provides a comprehensive overview of Markdown syntax, covering heading levels, text styling, unordered and ordered lists, blockquotes, inline and fenced code blocks, tables, horizontal rules, as well as link and image formatting, with clear examples for each feature.

Ops Development Stories
Ops Development Stories
Ops Development Stories
Master Markdown: A Complete Guide to Headings, Lists, Tables, and Code Blocks

1. Headings

Markdown supports up to six heading levels using the

#

symbol; the number of

#

characters determines the level, and a space must follow the symbols.

<code># Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6</code>

Demonstration

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5

Heading 6

2. Alternative Setext Headings

Only level‑1 and level‑2 headings can be expressed with the Setext style; the number of

=

or

-

characters is unrestricted as long as it exceeds one.

<code>Heading 1
=======
Heading 2
------</code>

Demonstration

3. Text Styling

Use asterisks or underscores for emphasis:

<code>**Bold**
*Italic* or _Italic_
***Bold Italic***
~~Strikethrough~~</code>

Demonstration

Bold

Italic

Bold Italic

Strikethrough

4. Lists

Unordered Lists

Three syntaxes are supported using

*

,

+

, or

-

:

<code>* Unordered item 1
* Unordered item 2
* Unordered item 3

+ Unordered item 4
+ Unordered item 5
+ Unordered item 6

- Unordered item 7
- Unordered item 8
- Unordered item 9</code>

Demonstration

Unordered item 1

Unordered item 2

Unordered item 3

Unordered item 4

Unordered item 5

Unordered item 6

Unordered item 7

Unordered item 8

Unordered item 9

Ordered Lists

Ordered lists are created by prefixing items with numbers:

<code>1. Ordered item 1
2. Ordered item 2
3. Ordered item 3</code>

Demonstration

Ordered item 1

Ordered item 2

Ordered item 3

5. Blockquotes

Prefix a line with

&gt;

to create a blockquote.

<code>&gt; Serve the people
&gt;          — Chairman Mao</code>

Demonstration

Serve the people — Chairman Mao

6. Code Blocks

Short or single‑line code can be wrapped with backticks; multi‑line code should be fenced with three backticks. Escape characters with a backslash when needed.

<code>`Short or single‑line code`
`\``
Multi‑line code {
    print ‘Life is short, I use Python’
}
`\``</code>

Demonstration

Short or single‑line code
<code>Multi‑line code {
    print ‘Life is short, I use Python’
}</code>

7. Tables

Tables are created using pipes

|

to separate cells and hyphens

-

for the header separator. Alignment is set with colons:

<code>|name|age|sex|
|:-----|:--:|----:|
|wanger|23|nan|
|lisi|20|nv|
|wangwu|22|nan|</code>

Demonstration

name

age

sex

wanger

23

nan

lisi

20

nv

wangwu

22

nan

8. Horizontal Rules

Insert three or more asterisks, hyphens, or underscores on a line by themselves, preceded by a blank line.

<code>---
___
***</code>

Demonstration

9. Links and Images

Links and images share similar syntax; images start with an exclamation mark. The title attribute is optional and appears on hover.

Image syntax:

![alt text](image_url "title")

Link syntax:

[link text](url "title")
<code>![WeChat QR](/uploads/wechat-qcode.jpg "WeChat QR")
[Personal Blog](https://wahaha5354.github.io "Personal Blog")</code>

Demonstration

DocumentationTutorialmarkdownformattingListsTablesText Styling
Ops Development Stories
Written by

Ops Development Stories

Maintained by a like‑minded team, covering both operations and development. Topics span Linux ops, DevOps toolchain, Kubernetes containerization, monitoring, log collection, network security, and Python or Go development. Team members: Qiao Ke, wanger, Dong Ge, Su Xin, Hua Zai, Zheng Ge, Teacher Xia.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.