Skip to content

Data tables

DocsForge renders Markdown tables with enhanced styling.

Basic table

| Method | Description |
|--------|-------------|
| `GET` | Retrieve a resource |
| `POST` | Create a new resource |
| `PUT` | Update a resource |
| `DELETE` | Remove a resource |
MethodDescription
GETRetrieve a resource
POSTCreate a new resource
PUTUpdate a resource
DELETERemove a resource

Aligned columns

| Left | Center | Right |
|:-----|:------:|------:|
| L    | C      | R     |
| left | center | right |
LeftCenterRight
LCR
leftcenterright

Wide tables

For tables with many columns, wrap them in a scrollable container:

<div class="md-typeset__scrollwrap"><div class="md-typeset__table">

| Column 1 | Column 2 | Column 3 | Column 4 | Column 5 |
|----------|----------|----------|----------|----------|
| Data     | Data     | Data     | Data     | Data     |

</div></div>

Tables with code

| Extension | Syntax | Description |
|-----------|--------|-------------|
| `admonition` | `!!! note` | Callout boxes |
| `attr_list` | `{: .class }` | HTML attributes |
| `pymdownx.highlight` | ` ```python ` | Code highlighting |
ExtensionSyntaxDescription
admonition!!! noteCallout boxes
attr_list{: .class }HTML attributes
pymdownx.highlight```pythonCode highlighting
| Feature | Guide | Reference |
|---------|-------|-----------|
| Colors | [Setup](../setup/changing-the-colors.md) | — |
| Fonts | [Setup](../setup/changing-the-fonts.md) | — |
| Admonitions | — | [Reference](admonitions.md) |
| Code blocks | — | [Reference](code-blocks.md) |
FeatureGuideReference
ColorsSetup
FontsSetup
AdmonitionsReference
Code blocksReference

CSV tables

For complex data, consider using the tables extension or importing from CSV:

markdown_extensions:
  - tables

Styling

Apply CSS classes to tables:

| Header 1 | Header 2 |
|----------|----------|
| Cell 1   | Cell 2   |
{: .highlight }

Table sorting

For interactive sorting, add the data-table class:

| Name | Age | Role |
|------|-----|------|
| Alice | 30 | Developer |
| Bob | 25 | Designer |
| Carol | 35 | Manager |
{: data-table }

Multi-line cells

Use <br> for line breaks within cells:

| Feature | Description |
|---------|-------------|
| Search | Full-text search<br>with highlighting |
| Dark mode | Light and dark<br>themes included |
FeatureDescription
SearchFull-text search
with highlighting
Dark modeLight and dark
themes included

Best practices

  • Keep tables under 10 columns for readability
  • Use |--------| alignment for visual consistency
  • Always include a header row for accessibility
  • Use (space) for empty cells, not ||
  • Wrap wide tables in scrollable containers

Next steps