MeshWorld India LogoMeshWorld.
CheatsheetMarkdownMDXDocumentationDeveloper ToolsWriting8 min read

Markdown Cheat Sheet: Syntax, Tables, and Extended Features

Vishnu
By Vishnu
|Updated: Jul 14, 2026
Markdown Cheat Sheet: Syntax, Tables, and Extended Features

Writing consistent, well-structured documentation requires a solid grasp of markup formatting. Markdown simplifies HTML tag creation by using plain-text characters to structure headings, tables, lists, links, and code blocks. This cheat sheet serves as a comprehensive reference guide for standard Markdown syntax, GitHub-Flavored Markdown (GFM) extensions, and common formatting solutions.

Key Takeaways

  • Format core typography including headings, bolding, italics, and blockquotes with simple text tags.
  • Construct lists, task lists, links, and embedded images quickly using native markdown syntax.
  • Build GFM tables with custom column alignments and cell formats.
  • Write clean code references using inline backticks and fenced code blocks with language tags.

What is the Quick Reference Syntax?

This section provides quick-reference lookup tables for the most frequently used Markdown syntax elements.

Headings

SyntaxOutput
# H1Heading 1 (largest level)
## H2Heading 2
### H3Heading 3
#### H4Heading 4
##### H5Heading 5
###### H6Heading 6 (smallest level)

Always put a single space after #. Most Markdown parsers require it; some are forgiving, but all accept it.

Text Emphasis

SyntaxOutput
**bold** or __bold__bold
*italic* or _italic_italic
***bold and italic***bold and italic
~~strikethrough~~strikethrough (GFM extension)
`inline code`inline code
<mark>highlight</mark>highlighted text (HTML fallback)

Lists

SyntaxWhat it produces
- item or * item or + itemUnordered list item
1. itemOrdered list item
1. item (all 1s)Ordered list — numbers auto-increment
- nestedNested list (indent with 2–4 spaces)
- [x] doneChecked task list item (GFM)
- [ ] todoUnchecked task list item (GFM)

Always put a blank line before the first list item if it follows a paragraph block.

SyntaxWhat it produces
[text](url)Inline link
[text](url "title")Link with hover title
[text][ref]Reference-style link
[ref]: url "title"Reference definition (anywhere in doc)
<https://url>Autolink (GFM)
![alt text](url)Image
![alt](url "title")Image with title
[![alt](img-url)](link-url)Clickable image (image wrapped in link)

Blockquotes

SyntaxWhat it produces
> textBlockquote
>> nestedNested blockquote
> **Note:** textBlockquote with bold label
> continued (blank > between)Multi-paragraph blockquote

Code Blocks

SyntaxWhat it produces
`code`Inline code
```lang (opening fence)Fenced code block with syntax highlighting
``` (closing fence)End of fenced code block
4 spaces indentCode block (original spec, avoid in modern MD)
```diffDiff block (lines starting with +/- colored)

Horizontal Rules & Dividers

Any of these on their own line produces <hr />:

Syntax
---
***
___

Put blank lines before and after to avoid being parsed as a heading underline.

Escaping Special Characters

Prefix any Markdown special character with a backslash \ to render it literally:

Escaped SyntaxRenders as
\**
\##
\[[
````
||
\!!

Special characters that can be escaped: \ * _ {} [] () # + - . !


How to Use Fenced Code Blocks with Language Tags?

Always specify the language after the opening fence. It enables syntax highlighting in GitHub, VS Code previews, and static site generators.

markdown
```javascript
const greet = (name) => `Hello, ${name}!`;
```

```python
def greet(name):
    return f"Hello, {name}!"
```

```bash
echo "Hello, world!"
```

```sql
SELECT name, email FROM users WHERE active = true;
```

For a diff block, lines starting with + render green and lines with - render red:

markdown
```diff
- const url = "http://example.com";
+ const url = "https://example.com";
```

To show a code fence inside a code fence, use more backticks on the outer fence:

markdown
````markdown
```js
// this renders as a code block inside the example
```
````

How to Format Tables with Mixed Alignment?

A full GFM table uses hyphens for headers and pipes to separate columns. You can customize text alignment by adding colons to the separator row.

markdown
| Name       | Role      |   Salary |
| :----------| :-------: | -------: |
| Alice      | Engineer  |   $95,000 |
| Bob        | Designer  |   $88,000 |
| Carol      | Manager   |  $110,000 |

Renders as:

NameRoleSalary
AliceEngineer$95,000
BobDesigner$88,000
CarolManager$110,000
Table Formatting Tips
  • Pipes do not need to line up perfectly; the parser ignores extra white spaces.
  • Every row must contain the same number of cells as the header row.
  • You cannot put paragraphs or lists inside cells. For complex layouts, use HTML <table> blocks.

What are the GitHub-Flavored Markdown (GFM) Extensions?

GFM is GitHub’s superset of CommonMark. It is widely supported by static site engines (including this site via remark-gfm).

  • Task lists: Rendered as checkbox lists.
    markdown
    - [x] Write the README
    - [ ] Write tests
  • Strikethrough: Wrapping text in double tildes ~~ renders as strikethrough.
  • Autolinks: Bare URLs and email addresses become clickable without brackets (e.g. https://example.com).

How do I Use Footnotes in Extended Markdown?

Footnotes are supported in GitHub, Obsidian, and many static site generators.

markdown
Here is a sentence with a footnote.[^1]

[^1]: This is the footnote content. It will render at the bottom of the page.

How does Markdown Behavior Vary Across Parsers?

Different applications parse Markdown differently. Here is a feature availability breakdown:

FeatureCommonMarkGFM (GitHub)MDX (Astro)Obsidian
TablesNoYesYes (via remark-gfm)Yes
Task listsNoYesYesYes
StrikethroughNoYesYesYes
FootnotesNoYesRequires pluginYes
JSX ComponentsNoNoYesNo
Callout directivesNoNoYes (via plugin)Yes

For this site, all GFM extensions are supported, and JSX components work in .mdx files.

Avoid Common Pitfalls
  • Blank line before lists: Always leave an empty line before starting a list. Without it, many parsers merge the list items into the preceding paragraph.
  • Setext underlines: Hyphens immediately below text turn it into a heading. Separate dividers --- with blank lines.
  • Pipe characters in tables: Escape literal pipes inside tables with a backslash \| to prevent breaking columns.

Summary Checklist

  • Use ATX style headings (#) with a single space.
  • Format emphasis with asterisks (* and **) or GFM tildes (~~).
  • Build GFM tables using pipes and hyphens with colon alignment.
  • Frame code blocks with triple backticks and language tags.
  • Separate blocks (lists, tables, dividers) with blank lines.

Frequently Asked Questions

Can I write standard HTML tags inside Markdown?

Yes. Most Markdown parsers support inline HTML fallbacks. You can write tags like <u>underlined</u> or <img width="100"> directly in your document.

How do I write multi-line footnotes?

To span a footnote over multiple paragraphs, indent the subsequent paragraphs with four spaces or a tab under the footnote definition.

Can I combine MDX components inside GFM tables?

No. Standard markdown tables do not render JSX or MDX components inside cells reliably. Use HTML <table> syntax if you need interactive elements inside columns.


Share_This Twitter / X
Vishnu
Written By

Vishnu

Founder & Principal Architect at MeshWorld. Senior engineer and instructor specializing in AI agent systems, scalable web architecture, and modern development workflows.

Enjoyed this article?

Support MeshWorld and help us create more technical content