YouTip LogoYouTip

Markdown Tables and Code

Introduction

Tables and code blocks are essential Markdown features for technical documentation. They present structured data and programming examples clearly.

Tables

| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |

# Column alignment
| Left     | Center   | Right    |
|:---------|:--------:|---------:|
| Left     | Center   |    Right |

Inline Code

# Use backticks for inline code
Use `console.log()` to debug.
Install with `npm install package`.

Code Blocks

# Fenced code blocks (with language)
```javascript
function greet(name) {
    return `Hello, ${name}!`;
}
```

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

```bash
echo "Hello World"
```

Complex Tables

| Method | URL          | Description      |
|--------|--------------|------------------|
| GET    | /api/users   | List all users   |
| POST   | /api/users   | Create user      |
| GET    | /api/users/1 | Get user by ID   |
| PUT    | /api/users/1 | Update user      |
| DELETE | /api/users/1 | Delete user      |

Summary

Use pipe characters for tables, backticks for inline code, and fenced code blocks with language hints for syntax-highlighted code examples.

← Markdown Links and ImagesMarkdown Tutorial - Syntax Gui β†’