How to Create Tables and Horizontal Rules in Markdown (Markdown 101 - Part 07)

// SERIES: Markdown 101 (10 lessons · Jump to any part)
  1. 01 Capstone Practice - Write a Complete Markdown Article from Scratch (Markdown 101 - Part 10)
  2. 02 How to Add Links and SEO-Friendly Images in Markdown (Markdown 101 - Part 04)
  3. 03 How to Create Tables and Horizontal Rules in Markdown (Markdown 101 - Part 07)
  4. 04 How to Preview and Publish Markdown Posts to Hugo on GitHub Pages (Markdown 101 - Part 06)
  5. 05 How to Use Obsidian Callouts and Wikilinks and Export Cleanly to Hugo (Markdown 101 - Part 09)
  6. 06 How to Write Checklists, Footnotes, and Escaped Characters in Markdown (Markdown 101 - Part 08)
  7. 07 How to Write Headings, Paragraphs, and Emphasis in Markdown (Markdown 101 - Part 02)
  8. 08 How to Write Lists, Blockquotes, and Code Blocks in Markdown (Markdown 101 - Part 03)
  9. 09 Minimal Markdown Post Template and YAML Front Matter for Blogs (Markdown 101 - Part 05)
  10. 10 What Is Markdown and How to Create Your First .md File (Markdown 101 - Part 01)

Markdown 101 · Part 7/10

Use pipes | to separate columns and a row of hyphens --- beneath the header row to create a Markdown table. To divide major sections, place --- on its own blank line to draw a horizontal rule.

Build a Basic Table

Tables are part of GitHub Flavored Markdown (GFM) and work natively in Hugo, Obsidian, and GitHub:

| Syntax | Meaning | Example |
| --- | --- | --- |
| `#` | Heading | `# Chapter 1` |
| `-` | List | `- Task 1` |

The first row defines column headers. The second row must contain at least three hyphens --- per column, and every data row should match the header column count.

Align Columns Left, Center, or Right

Add colons : to the separator row to control alignment for an entire column:

| Item | Quantity | Price |
| :--- | :---: | ---: |
| Notebook | 2 | $12.00 |
| Pen | 5 | $4.50 |
  • :--- aligns left (default).
  • :---: centers text.
  • ---: aligns right, ideal for numbers and prices.

Horizontal Rules and Multi-Line Cells

Place --- (or ***) on its own line with a blank line above it to render a horizontal divider. Without a blank line above ---, Markdown parsers treat the preceding line as a level-2 heading.

If you need a line break inside a table cell, use <br>—pressing Enter directly will break the table row.

Practice Now

Add a third row to the table below and insert a horizontal rule --- beneath it.

Practice Now

Add one new row to the table and place a horizontal rule --- below the table.

Live Preview
Show hint

Separate columns with |. Leave a blank line above --- to create a horizontal rule.

Runs locally in your browser (nothing is uploaded or auto-saved). Supports headings, paragraphs, lists, checklists, tables, blockquotes, code, emphasis, links, and local site images.

Source: GitHub Flavored Markdown Spec: Tables.


In the Markdown 101 series:

Loading comments...