# Lists and Tables

This page covers ordered and unordered lists, nesting rules, checkboxes, and tables with column alignment.

## Lists

| Source | Output |
|---|---|
| `- item`, `* item`, `+ item` | `<ul>` |
| `1. item` | `<ol>` |
| `- [x] done`, `- [ ] todo` | `<li>` with a checkbox |

| Rule | Detail |
|---|---|
| Type set by the first item | If the first item is `1.`, the whole group is `<ol>`; mixing markers at one level does not split groups |
| Start number | Ignored; `3. x` still counts from 1 and no `start` attribute is emitted |
| Nesting | 4 spaces of indentation per level; a 2-space indent is treated as a sibling item |
| Nested type may differ | `1. sub` indented under `- a` creates an `<ol>` inside the `<ul>` |
| Continuation lines | A following line without a list marker is appended to the previous item, separated by `<br>` |
| End | A blank line |

## Checkboxes

```markdown
- [x] Done
- [ ] Not done
```

The output is `<label><input type="checkbox"><span>text</span></label>`, with `checked` for `[x]`. The checkbox has `onclick="return false;"`, so it cannot be toggled in the preview; change the Markdown source instead.

## Tables

```markdown
| Name  | Qty | Price |
|:------|:---:|------:|
| Apple |  3  |    30 |
```

| Rule | Detail |
|---|---|
| Separator row | The second line, made of `-`, `:` and `\|`, marks the header and alignment |
| Outer `\|` | Optional: `A \| B` followed by `--- \| ---` also works |
| Column count | Taken from the first (header) row; missing cells in data rows become empty `<td>`, extra cells are dropped |
| Headings in cells | `## text` inside a cell produces a heading |

## Alignment

| Separator | `align` attribute |
|---|---|
| `---`, `:---` | `left` |
| `:---:` | `center` |
| `---:` | `right` |

Alignment is written as an `align` attribute on every `<th>` and `<td>`; it defaults to `left`.

## Limits

- The form without outer `|` does not check for list markers: `- a | b` followed by `--- | ---` becomes a table whose header is `- a`
- `\|` escaping is not supported inside cells; every `|` separates columns
