Table Formatter

by fangface-hub
5
4
3
2
1
Score: 35/100

Description

Formats Markdown tables when files are saved. - This plugin has not been manually reviewed by Obsidian staff.

Reviews

No reviews yet.

Stats

stars
135
downloads
0
forks
3
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

obsidian_table_formatter

An Obsidian plugin for formatting Markdown tables on save.

Features

  • Formats Markdown tables whenever a Markdown file is saved.
  • Runs auto-format only while editing in Source mode.
  • Applies focus/selection restoration only in Source mode.
  • Lets you format manually with the ribbon button (table icon) or the command palette.
  • Can format every Markdown file in the vault at once with the command "Format tables in all files", which is handy when you first add the plugin to an existing vault. It asks for confirmation first and reports how many files were changed.
  • Adds a ribbon toggle button (power icon) to force-enable/disable auto-format and focus control while editing.
  • Shows an ON/OFF toggle in the main screen status bar for quick switching.
  • Supports configurable table cell padding:
    • Fixed number of spaces (0 or more)
    • Blank (auto mode: single-space minimal formatting)
  • Supports configurable number of - characters in the delimiter row.
  • Keeps column alignment: the : markers in the delimiter row (:---, ---:, :---:) are preserved.

Settings

Open: Settings -> Community plugins -> Table Formatter

  • Padding spaces
    • Blank: | cell | style (single-space padding)
    • Integer (>= 0): exactly that many spaces around each cell
  • Table border dash count
    • Blank: auto (based on content width, minimum 3)
    • Integer (>= 1): fixed number of - in each delimiter cell. Alignment colons (:) are kept and placed around the dashes, so a left-aligned column with dash count 3 becomes :---.
  • Enable auto-format and focus control while editing
    • ON: run modify-triggered formatting and focus/selection restoration in Source mode
    • OFF: force-disable those editing features

Images

  • Editor screen

Editor Screen

  • Setting screen

Setting Screen

Development

npm install
npm run dev

Run lint:

npm run lint

Auto-fix lint issues:

npm run lint:fix

Build production bundle:

npm run build

Note: npm run build runs lint first via esbuild.config.mjs.

Community Plugin Release

Use one of the following version bump scripts depending on the scope of changes:

  • npm run version:patch
    • For backward-compatible fixes only (x.y.z -> x.y.(z+1))
  • npm run version:minor
    • For backward-compatible feature additions (x.y.z -> x.(y+1).0)
  • npm run version:major
    • For breaking changes (x.y.z -> (x+1).0.0)

Each script updates package.json, package-lock.json, manifest.json, and versions.json together.

  1. Commit and push to GitHub.
  2. Create a GitHub Release with tag exactly matching manifest.json version.
  3. Attach release assets: main.js, manifest.json, styles.css (optional), versions.json (recommended).
  4. Submit the repository URL from Obsidian Community Plugins.

Notes:

  • manifest.json in the default branch must be up to date before submission.
  • Plugin id must be unique and must not contain obsidian.