Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 2.24 KB

tables-basics.md

File metadata and controls

59 lines (44 loc) · 2.24 KB

Markdown Tables Basics

There are some distinctions between Markdown and GitHub Flavored Markdown, but I only use Markdown on GitHub since it't what I'm most familiar with and what I need to remember. It's probably where most people use Markdown the most.

Markdown tables are pretty awesome, quick, and most of the syntax is intuitive. Cells can contain Markdown with some exceptions, like block elements:

  • Fenced code blocks (```\n```)
  • Blockquotes (>)
  • Collapsible sections (<details><summary></summary></details>)

Markdown tables, like Markdown in general, can contain images and HTML.

This is what I normally do:

| Column A | Column B |
|--|--|
| A1 | B1 |
Column A Column B
A1 B1

Colons (:) align columns

| Default = Left-align |   Centered    | Right-aligned |
| -------------------- | :-----------: | ------------: |
| col 2 is             |   centered    |         $1600 |
| col 3 is             | right-aligned |           $12 |
Default = Left-align Centered Right-aligned
col 2 is centered $1600
col 3 is right-aligned $12

The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.

Markdown | Less | Pretty
--- | --- | ---
*Still* | `renders` | **nicely**
1 | 2 | 3
Markdown Less Pretty
Still renders nicely
1 2 3

Resources