Tables

Create formatted tables in Markdown

#tables #formatting #columns #rows

Tables

Create tables using pipes and dashes in Markdown.

Basic Table

| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Row 1    | Data     | Data     |
| Row 2    | Data     | Data     |

Result:

Header 1 Header 2 Header 3
Row 1 Data Data
Row 2 Data Data

Column Alignment

| Left | Center | Right |
|:-----|:------:|------:|
| Text | Text   | Text  |
| More | More   | More  |
  • :--- = Left aligned
  • :---: = Center aligned
  • ---: = Right aligned

Minimal Table

Header 1 | Header 2
---|---
Data 1 | Data 2
Data 3 | Data 4

Outer pipes are optional!

Table with Mixed Content

| Feature | Status | Priority |
|---------|:------:|---------:|
| Login   | ✓      | High     |
| Search  | ✗      | Medium   |
| Export  | ⚠️      | Low      |

Inline Formatting in Tables

| Name | Description |
|------|-------------|
| **Bold** | Use `code` |
| *Italic* | With [links](https://example.com) |

Result:

Name Description
Bold Use code
Italic With links

Multi-line Content

| Column 1 | Column 2 |
|----------|----------|
| Line 1<br>Line 2 | Data |
| More | Content<br>Here |

Use <br> for line breaks within cells.

Empty Cells

| A | B | C |
|---|---|---|
| 1 | 2 |   |
|   | 4 | 5 |

Wide Tables

| Feature | Description | Status | Priority | Assignee | Due Date |
|---------|-------------|--------|----------|----------|----------|
| Feature A | Long description... | Done | High | Alice | 2025-01-15 |
| Feature B | Another description... | In Progress | Medium | Bob | 2025-01-20 |

Table with Numbers

| Product | Price | Quantity | Total |
|---------|------:|---------:|------:|
| Widget  | $10.00 | 5 | $50.00 |
| Gadget  | $25.50 | 2 | $51.00 |
| **Total** | | | **$101.00** |

Result with right-aligned numbers:

Product Price Quantity Total
Widget $10.00 5 $50.00
Gadget $25.50 2 $51.00
Total $101.00

Complex Table Example

| Language | Type | Paradigm | First Appeared |
|:---------|:----:|:--------:|---------------:|
| Python   | Interpreted | Multi-paradigm | 1991 |
| JavaScript | Interpreted | Multi-paradigm | 1995 |
| Go       | Compiled | Concurrent | 2009 |

Escaping Pipes

| Code | Output |
|------|--------|
| `a \| b` | Pipe character |
| `<code>a \| b</code>` | HTML escape |

Use backslash \| to escape pipes in content.

Table Best Practices

  • Keep tables simple and readable
  • Use alignment for better visual clarity
  • Consider responsiveness on mobile
  • For complex data, consider alternatives (charts, lists)
  • Ensure adequate spacing between columns

When NOT to Use Tables

<!-- Instead of this: -->
| Property | Value |
|----------|-------|
| Name | John |
| Age | 30 |

<!-- Consider this: -->
- **Name:** John
- **Age:** 30

Use lists for simple key-value pairs!

Discover another handy tool from EditPDF.pro