Markdown Table Creator is a Sublime Text plugin that helps you create and reformat Markdown tables quickly.
Demo video:
MarkdownTableCreator_demo.mov
- Open the Command Palette (
Tools > Command Palette) - Search for
Package Control: Install Packageand select it - Search for
Markdown Table Creatorand select it to install
https://packagecontrol.io/packages/Markdown%20Table%20Creator
- Open Sublime Text package directory with
Sublime Text > Preferences > Browse Packages.... - Copy the files to
Userdirectory.
- Type 1+ header names, separated with
|(or configuredextra_header_separators) - Type content data, separated with
|(or configuredextra_content_separators) (optional) - Select the text you want to convert to Markdown table
- Select
Markdown Table Creatorfrom Command Palette, or hit the defined key binding
- Make any change in header/content data, alignment, or table structure
- Select the Markdown table
- Select
Markdown Table Creatorfrom Command Palette, or hit the defined key binding
Before
City|Country|Population
After
| City | Country | Population |
|---|
Before
City\Country\Population
After
| City | Country | Population |
|---|
Before
City\Country\Population
London|UK|8M
Istanbul|Turkey|12M
After
| City | Country | Population |
|---|---|---|
| London | UK | 8M |
| Istanbul | Turkey | 12M |
Before
City (Default Left)|:Country (Centered):|Population (Right):
London|UK|8M
Istanbul|Turkey|12M
After
| City (Default Left) | Country (Centered) | Population (Right) |
|---|---|---|
| London | UK | 8M |
| Istanbul | Turkey | 12M |
You can add a keymap with
Sublime Text > Preferences > Key Bindings
Example:
{ "keys": ["alt+shift+t"], "command": "markdown_table_creator" }
{
// This will be used to align the column when alignment is not specified with ":"
// Can be "left" / "right" / "center"
"default_alignment": "left",
// Each of the characters will be used to separate header line together with "|"
"extra_header_separators": "",
// Each of the characters will be used to separate content lines together with "|"
"extra_content_separators": "",
// Enabling debug_mode will print errors after the selected text
"debug_mode": false,
}