Markdown 语法速查表(最全整理)
把最常用的 Markdown 写法收进一张表。写文档卡壳时翻一下,照着敲,右边立刻出效果。
Markdown 語法速查表(最全整理)
把最常用的 Markdown 寫法收進一張表。寫文件卡住時翻一下,照著敲,右邊立刻出效果。
Markdown Syntax Cheat Sheet (Complete)
The most common Markdown syntax gathered onto one page. When you get stuck writing, glance at it, type along, and see the result on the right instantly.
一、基础排版的写法
下面这张表覆盖标题、加粗、斜体等 90% 的日常需求。星号 / 下划线两种写法效果一致,挑顺手的用即可。
| 效果 | 怎么写 |
|---|---|
| 一级标题 | # 标题 |
| 六级标题 | ###### 标题(# 后必须留一个空格) |
| 加粗 | **粗体** 或 __粗体__ |
| 斜体 | *斜体* 或 _斜体_ |
| 删除线 | ~~划掉~~ |
| 高亮(部分解析器) | ==重点== |
| 行内代码 | `code` |
| 段落换行 | 段尾空两格,或直接空一行再写 |
| 分割线 | 单独一行写 --- 或 *** |
小提醒:标题必须在 # 后面加空格,#标题 不会被识别;这是新手 90% 的“为什么没生效”。
二、列表与任务清单
无序列表用 - / * / +,有序列表用数字加点。想做嵌套,子项比父项多缩进 2 个空格。
- 水果
- 苹果
- 香蕉
- 蔬菜
1. 第一步
2. 第二步
- [x] 已完成的任务
- [ ] 还没做的任务
任务清单(- [ ])在支持的地方会渲染成可勾选的方框,写周计划、需求清单特别顺手。
三、代码与引用
行内代码用一对反引号 `code`;成块代码用三反引号包裹,并可在开头标注语言以开启高亮:
```python
def hello():
print("Hello, Markdown")
```
引用用 > 开头;连续多行引用可以每行都加 >,或在段落间空行后继续。
> 这是一句引用。
> 第二行依旧是引用。
普通段落,引用结束。
四、链接、图片与表格
链接和图片语法只差一个叹号,记住“图片就是带 ! 的链接”就好:
| 效果 | 写法 |
|---|---|
| 链接 | [365Lab](https://markdown.365lab.top/) |
| 图片 |  |
| 引用式链接 | [文字][id],文末写 [id]: 地址 |
表格用管道符 | 分隔列,第二行用 --- 划底线,冒号控制对齐:
| 名称 | 价格 | 说明 |
| :--- | ---: | :---: |
| 苹果 | 5 | 左对齐 |
| 香蕉 | 3 | 右对齐 |
左 :---、右 ---:、居中 :---:。更细的玩法见 Markdown 表格怎么写。
五、进阶:公式、脚注、分割线
不少编辑器(包括 365Lab)支持用 LaTeX 写数学公式:单个 $ 包裹行内公式,双 $$ 包裹独立成行的公式。想深入看 Markdown 写数学公式。
行内:$E = mc^2$
独立成行:
$$\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$$
脚注用 [^1],文末再写 [^1]: 注释内容;正文里出现上标,鼠标悬停看解释,写论文、报告很实用。
六、常见问题
Q:为什么我的 # 没变成标题?
A:检查 # 后面是否少了一个空格;另外确保不是在一行最前面有缩进(缩进的 # 可能被当成代码块)。
Q:表格对不齐怎么办?
A:对齐只影响最终排版,写的时候列数对齐与否都能渲染;重点是每一行的管道符数量一致。
Q:这些写法在所有平台都通用吗?
A:核心语法(标题、列表、粗斜体、链接、图片、引用、代码)几乎全平台通用;公式、脚注、任务清单、高亮属于扩展,老平台可能不显示,先在目标平台试一下。
Q:有没有地方能一边看一边试?
A:打开 365Lab 在线编辑器,把上表任意一行粘到左边,右边实时出效果,免注册。
想系统学一遍,先看 Markdown 是什么?10 分钟上手指南;要把文档变成 PDF 或 Word,见 Markdown 转 PDF 与 Markdown 转 Word。用勾选框做待办看 Markdown 任务清单,画流程图看 用 Mermaid 画图表。
一、基礎排版的寫法
下面這張表涵蓋標題、加粗、斜體等 90% 的日常需求。星號 / 底線兩種寫法效果一致,挑順手的用即可。
| 效果 | 怎麼寫 |
|---|---|
| 一級標題 | # 標題 |
| 六級標題 | ###### 標題(# 後必須留一個空格) |
| 加粗 | **粗體** 或 __粗體__ |
| 斜體 | *斜體* 或 _斜體_ |
| 刪除線 | ~~劃掉~~ |
| 高亮(部分解析器) | ==重點== |
| 行內程式碼 | `code` |
| 段落換行 | 段尾空兩格,或直接空一行再寫 |
| 分隔線 | 單獨一行寫 --- 或 *** |
小提醒:標題必須在 # 後面加空格,#標題 不會被識別;這是新手 90% 的「為什麼沒生效」。
二、清單與任務清單
無序清單用 - / * / +,有序清單用數字加點。想做巢狀,子項比父項多縮排 2 個空格。
- 水果
- 蘋果
- 香蕉
- 蔬菜
1. 第一步
2. 第二步
- [x] 已完成的任務
- [ ] 還沒做的任務
任務清單(- [ ])在支援的地方會渲染成可勾選的方框,寫週計畫、需求清單特別順手。
三、程式碼與引用
行內程式碼用一對反引號 `code`;成塊程式碼用三個反引號包裹,並可在開頭標註語言以開啟高亮:
```python
def hello():
print("Hello, Markdown")
```
引用用 > 開頭;連續多行引用可以每行都加 >,或在段落間空行後繼續。
> 這是一句引用。
> 第二行依舊是引用。
一般段落,引用結束。
四、連結、圖片與表格
連結和圖片語法只差一個驚嘆號,記住「圖片就是帶 ! 的連結」就好:
| 效果 | 寫法 |
|---|---|
| 連結 | [365Lab](https://markdown.365lab.top/) |
| 圖片 |  |
| 參照式連結 | [文字][id],文末寫 [id]: 位址 |
表格用管線符 | 分隔欄,第二行用 --- 畫底線,冒號控制對齊:
| 名稱 | 價格 | 說明 |
| :--- | ---: | :---: |
| 蘋果 | 5 | 靠左 |
| 香蕉 | 3 | 靠右 |
靠左 :---、靠右 ---:、置中 :---:。更細的玩法見 Markdown 表格怎麼寫。
五、進階:公式、註腳、分隔線
不少編輯器(包含 365Lab)支援用 LaTeX 寫數學公式:單個 $ 包裹行內公式,雙 $$ 包裹獨立成行的公式。想深入看 Markdown 寫數學公式。
行內:$E = mc^2$
獨立成行:
$$\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$$
註腳用 [^1],文末再寫 [^1]: 註釋內容;正文裡出現上標,滑鼠懸停看解釋,寫論文、報告很實用。
六、常見問題
Q:為什麼我的 # 沒變成標題?
A:檢查 # 後面是否少了一個空格;另外確保不是在一行最前面有縮排(縮排的 # 可能被當成程式碼塊)。
Q:表格對不齊怎麼辦?
A:對齊只影響最終排版,寫的時候欄數對不對齊都能渲染;重點是每一行的管線符數量一致。
Q:這些寫法在所有平台都通用嗎?
A:核心語法(標題、清單、粗斜體、連結、圖片、引用、程式碼)幾乎全平台通用;公式、註腳、任務清單、高亮屬於擴充,老平台可能不顯示,先在目標平台試一下。
Q:有沒有地方能一邊看一邊試?
A:打開 365Lab 線上編輯器,把上表任意一行貼到左邊,右邊即時出效果,免註冊。
想系統學一遍,先看 Markdown 是什麼?10 分鐘上手指南;要把文件變成 PDF 或 Word,見 Markdown 轉 PDF 與 Markdown 轉 Word。用勾選框做待辦看 Markdown 任務清單,畫流程圖看 用 Mermaid 畫圖表。
1. Basic formatting
This table covers 90% of daily needs—headings, bold, italic, and more. The asterisk and underscore forms do the same thing, so just use whichever feels natural.
| Effect | How to write |
|---|---|
| Heading level 1 | # Heading |
| Heading level 6 | ###### Heading (a space is required after #) |
| Bold | **bold** or __bold__ |
| Italic | *italic* or _italic_ |
| Strikethrough | ~~struck~~ |
| Highlight (some parsers) | ==highlight== |
| Inline code | `code` |
| Paragraph break | Two trailing spaces, or a blank line |
| Horizontal rule | Write --- or *** on its own line |
Tip: A heading must have a space after #; #Heading won't be recognized—that's 90% of beginners' "why didn't it work."
2. Lists and task lists
Unordered lists use - / * / +; ordered lists use a number plus a dot. To nest, indent the child item two spaces more than its parent.
- Fruit
- Apple
- Banana
- Vegetable
1. First step
2. Second step
- [x] Completed task
- [ ] Not done yet
Task lists (- [ ]) render as checkable boxes where supported—handy for weekly plans and requirement lists.
3. Code and quotes
Inline code uses a pair of backticks `code`; a fenced block uses three backticks and can name a language at the start to enable highlighting:
```python
def hello():
print("Hello, Markdown")
```
A quote starts with >. For a multi-line quote, add > to each line, or leave a blank line between paragraphs and continue.
> This is a quote.
> The second line is still quoted.
A normal paragraph ends the quote.
4. Links, images, and tables
Links and images differ by just one exclamation mark—remember "an image is just a link with !":
| Effect | How to write |
|---|---|
| Link | [365Lab](https://markdown.365lab.top/) |
| Image |  |
| Reference link | [text][id], then [id]: URL at the end |
Tables use the pipe | to separate columns, a --- row underneath for the border, and colons for alignment:
| Name | Price | Note |
| :--- | ---: | :---: |
| Apple | 5 | left |
| Banana | 3 | right |
Left :---, right ---:, center :---:. For the finer details, see How to write Markdown tables.
5. Advanced: math, footnotes, rules
Many editors (including 365Lab) support LaTeX math: a single $ wraps an inline formula, and double $$ wraps a formula on its own line. To go deeper, see Writing math in Markdown.
Inline: $E = mc^2$
On its own line:
$$\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$$
Footnotes use [^1], then [^1]: note content at the end; a superscript appears in the text and a hover reveals the explanation—great for papers and reports.
6. FAQ
Q: Why didn't my # turn into a heading?
A: Check whether there's a missing space after #; also make sure it isn't indented at the start of the line (an indented # may be treated as a code block).
Q: What if my table won't align?
A: Alignment only affects the final layout; columns render whether or not they line up while writing. The key is that every row has the same number of pipe characters.
Q: Do these syntaxes work on every platform?
A: Core syntax (headings, lists, bold/italic, links, images, quotes, code) is nearly universal; math, footnotes, task lists, and highlighting are extensions that older platforms may not show—test on the target platform first.
Q: Is there a place to try it while I read?
A: Open the 365Lab online editor, paste any row from the table on the left, and see the result instantly on the right—no sign-up needed.
To learn it systematically, start with What Is Markdown? A 10-Minute Guide; to turn docs into PDF or Word, see Markdown to PDF and Markdown to Word. For to-dos with checkboxes, see Markdown task lists, and for flowcharts see Diagrams with Mermaid.