{"id":5316,"library":"mdformat-tables","title":"mdformat-tables","description":"mdformat-tables is a plugin for the `mdformat` markdown formatter, designed specifically for rendering tables according to the GitHub Flavored Markdown (GFM) specification. It ensures tables are consistently formatted and properly aligned. The library is actively maintained, with its current version being 1.0.0, and follows a stable release cadence driven by updates to `mdformat`.","status":"active","version":"1.0.0","language":"en","source_language":"en","source_url":"https://github.com/executablebooks/mdformat-tables","tags":["markdown","formatter","mdformat-plugin","tables","gfm"],"install":[{"cmd":"pip install mdformat-tables mdformat","lang":"bash","label":"Install with mdformat"}],"dependencies":[{"reason":"This package is an mdformat plugin and requires mdformat to function.","package":"mdformat"}],"imports":[{"note":"Importing the package registers it as an mdformat plugin. Its functionality is then accessed via `mdformat`'s API or CLI using the plugin name 'tables'.","symbol":"mdformat_tables","correct":"import mdformat_tables"}],"quickstart":{"code":"import mdformat\nimport mdformat_tables # This registers the plugin\n\nmarkdown_with_table = \"\"\"\n| Header 1 | Header 2 |\n|----------|----------|\n| Row 1 Col 1 | Row 1 Col 2 |\n| Row 2 Col 1 | Row 2 Col 2 |\n\"\"\"\n\nformatted_markdown = mdformat.format_markdown(markdown_with_table, plugins=['tables'])\nprint(formatted_markdown)","lang":"python","description":"This example demonstrates how to use `mdformat-tables` programmatically. By simply importing `mdformat_tables`, the plugin is registered with `mdformat`. You then pass `plugins=['tables']` to `mdformat.format_markdown` to enable table formatting."},"warnings":[{"fix":"Upgrade to Python 3.7+ or pin `mdformat-tables<1.0.0`.","message":"Python 3.6 support was dropped in `v1.0.0`. Users on older Python versions must either upgrade their Python environment or pin `mdformat-tables` to an earlier version (e.g., `<1.0.0`).","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Always install the latest `mdformat-tables` with the latest `mdformat` or consult their respective changelogs for specific compatibility notes. Ensure both libraries are kept up-to-date in sync.","message":"Compatibility with `mdformat` versions is crucial. `mdformat-tables` versions are often synced with specific `mdformat` versions due to internal API changes (e.g., `v0.3.0` synced with `mdformat 0.6.0`). Mismatched versions can lead to unexpected formatting or errors.","severity":"gotcha","affected_versions":"<1.0.0 (especially before v0.3.0)"},{"fix":"Upgrade to `mdformat-tables>=0.4.1` to ensure correct pipe escaping and table parsing.","message":"Prior to `v0.4.1`, tables containing unescaped pipe characters (`|`) within cells could be incorrectly rendered or parsed, leading to malformed output.","severity":"gotcha","affected_versions":"<0.4.1"},{"fix":"Upgrade to `mdformat-tables>=0.4.0` for improved handling of potential table delimiter rows.","message":"Before `v0.4.0`, lines that visually resembled table delimiter rows (e.g., `--- | ---`) but were not intended as such could be misinterpreted and incorrectly escaped, affecting non-table content.","severity":"gotcha","affected_versions":"<0.4.0"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}