JSON to Markdown · 6 min read

Control Column Order and Text Alignment When Converting JSON to Markdown Tables

Most JSON-to-Markdown converters use the raw JSON key order, which often doesn't match the column layout you want in your documentation. You might want name first, price last, and numbers aligned to the right. This guide shows how to control column ordering and alignment using the JSON to Markdown Converter.

Why Column Order and Alignment Matter

A well-formatted Markdown table is easy to scan. Poor column ordering forces readers to hunt for the information they need. Without alignment control, numbers blend with text and comparisons become difficult:

Without these controls, you end up manually editing the raw Markdown — which is tedious and error-prone.

1. Reordering Columns

By default, the converter uses JSON key order. But you can specify a custom column sequence. Consider this JSON:

[
  {"sku": "WGT-100", "name": "Widget Aluminum", "price": 24.99, "stock": 150, "active": true},
  {"sku": "WGT-200", "name": "Widget Steel", "price": 39.99, "stock": 85, "active": true},
  {"sku": "WGT-300", "name": "Widget Titanium", "price": 89.99, "stock": 30, "active": false}
]

Set the column order to name, sku, price, stock, active in the converter settings. The output table becomes:

| name | sku | price | stock | active |
| --- | --- | --- | --- | --- |
| Widget Aluminum | WGT-100 | 24.99 | 150 | true |
| Widget Steel | WGT-200 | 39.99 | 85 | true |
| Widget Titanium | WGT-300 | 89.99 | 30 | false |

Notice that name (the most important column) now appears first, not sku.

2. Setting Per-Column Alignment

Markdown table alignment is controlled by colons in the separator row:

In the converter, set text fields to left, price to right, and active (a boolean) to center:

| name | sku | price | stock | active |
| :--- | :--- | ---: | ---: | :---: |
| Widget Aluminum | WGT-100 | 24.99 | 150 | true |
| Widget Steel | WGT-200 | 39.99 | 85 | true |
| Widget Titanium | WGT-300 | 89.99 | 30 | false |

Prices and stock numbers now align to the right, making them easy to compare vertically. The active column is centered for quick scanning.

3. Handling Pipe Characters and Special Content

JSON values sometimes contain pipes (|), backticks, or HTML. In GFM tables, pipes are column separators, so they must be escaped as \|. The converter handles this automatically:

[
  {"feature": "Pipe support", "syntax": "A | B", "notes": "vertical bar"},
  {"feature": "Inline code", "syntax": "`code`", "notes": "backtick"}
]

Becomes:

| feature | syntax | notes |
| --- | --- | --- |
| Pipe support | A \| B | vertical bar |
| Inline code | `code` | backtick |

Without escaping, the pipe in A | B would create extra table columns and break the layout.

Try the Free JSON to Markdown Converter

Control column order, set alignment, and auto-escape special characters. All browser-based, no signup needed.

Convert JSON to Markdown Now →

Best Practices for JSON to Markdown Table Conversion

Frequently Asked Questions

How do I control column order when converting JSON to a Markdown table?

Use the JSON to Markdown converter's column mapping feature. Drag and drop fields to reorder them, or specify a field order list. The table renders columns in the order you define, not the JSON key order.

Can I set different text alignment for each column in a Markdown table?

Yes. The converter supports left (:---), center (:---:), and right (---:) alignment. Numbers commonly use right alignment, text uses left, and short status fields look best centered. The alignment is set per column.

How does the tool handle pipe characters in JSON values?

Pipe characters (|) in JSON values are automatically escaped as \| in the Markdown output. This prevents them from being interpreted as table column separators in GitHub-Flavored Markdown.

Does the converter work with GitHub, GitLab, and Bitbucket Markdown?

Yes. The output follows standard GitHub-Flavored Markdown (GFM) table syntax, which works across GitHub, GitLab, Bitbucket, Notion, Obsidian, and most static site generators.

Is my data safe when converting JSON to Markdown tables?

100% safe. All processing happens in your browser. Your JSON data never leaves your computer. No server uploads, no storage, no tracking.