{"id":15434290,"url":"https://github.com/cenfun/markdown-grid","last_synced_at":"2026-04-29T10:03:14.392Z","repository":{"id":56772437,"uuid":"524845781","full_name":"cenfun/markdown-grid","owner":"cenfun","description":"Markdown Grid Generator","archived":false,"fork":false,"pushed_at":"2022-11-30T02:51:07.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T01:11:25.942Z","etag":null,"topics":["generator","grid","markdown"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/markdown-grid","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cenfun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-15T03:39:34.000Z","updated_at":"2024-12-15T07:03:20.000Z","dependencies_parsed_at":"2022-08-16T02:30:42.114Z","dependency_job_id":null,"html_url":"https://github.com/cenfun/markdown-grid","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenfun%2Fmarkdown-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenfun%2Fmarkdown-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenfun%2Fmarkdown-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenfun%2Fmarkdown-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cenfun","download_url":"https://codeload.github.com/cenfun/markdown-grid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245978277,"owners_count":20703678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generator","grid","markdown"],"created_at":"2024-10-01T18:38:40.109Z","updated_at":"2026-04-29T10:03:14.317Z","avatar_url":"https://github.com/cenfun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markdown-grid\n\u003e Markdown Grid Generator\n\n## Install\n```sh\nnpm i markdown-grid\n```\n## Usage\n\nData Format Definition: [CGDF](https://github.com/cenfun/cgdf)\n\n```js  \nconst MG = require(\"markdown-grid\");\nconst mg = MG({\n    \"columns\": [\"\", \"Name\", \"Value\"],\n    \"rows\": [\n        [1, \"Tom\", \"Value 1\"],\n        [2, \"Jerry\", \"Value 2\"]\n    ]\n});\n\nconsole.log(mg);  \n\n|   |Name|Value|\n|---|----|-----|\n|1  |Tom |Value 1|\n|2  |Jerry|Value 2|  \n```  \n|   |Name|Value|\n|---|----|-----|\n|1  |Tom |Value 1|\n|2  |Jerry|Value 2|  \n## With column width:  \n```js  \nconst MG = require(\"markdown-grid\");\nconst mg = MG({\n    \"columns\": [\"\", {\n        \"name\": \"Name\",\n        \"width\": 15\n    }, {\n        \"name\": \"Value\",\n        \"width\": 35\n    }],\n    \"rows\": [\n        [1, \"Hello\", \"Long Text Value\"],\n        [2, \"Hello There\", \"Long Text Value Long Text Value\"]\n    ]\n});\n\nconsole.log(mg);  \n\n|   |Name           |Value                              |\n|---|---------------|-----------------------------------|\n|1  |Hello          |Long Text Value                    |\n|2  |Hello There    |Long Text Value Long Text Value    |  \n```  \n|   |Name           |Value                              |\n|---|---------------|-----------------------------------|\n|1  |Hello          |Long Text Value                    |\n|2  |Hello There    |Long Text Value Long Text Value    |  \n## With column align and padding:  \n```js  \nconst MG = require(\"markdown-grid\");\nconst mg = MG({\n    \"options\": {\n        \"padding\": 1\n    },\n    \"columns\": [{\n        \"id\": \"default\",\n        \"name\": \"Default\",\n        \"width\": 10\n    }, {\n        \"id\": \"left\",\n        \"name\": \"Left\",\n        \"width\": 10,\n        \"align\": \"left\"\n    }, {\n        \"id\": \"center\",\n        \"name\": \"Center\",\n        \"width\": 10,\n        \"align\": \"center\"\n    }, {\n        \"id\": \"right\",\n        \"name\": \"Right\",\n        \"width\": 10,\n        \"align\": \"right\"\n    }],\n    \"rows\": [{\n        \"default\": \"Cell\",\n        \"left\": \"Markdown\",\n        \"center\": \"Start\",\n        \"right\": \"123.0\"\n    }, {\n        \"default\": \"Content\",\n        \"left\": \"Grid\",\n        \"center\": \"Complete\",\n        \"right\": \"8.1\"\n    }]\n});\n\nconsole.log(mg);  \n\n| Default    | Left       |   Center   |      Right |\n| ---------- | :--------- | :--------: | ---------: |\n| Cell       | Markdown   |    Start   |      123.0 |\n| Content    | Grid       |  Complete  |        8.1 |  \n```  \n| Default    | Left       |   Center   |      Right |\n| ---------- | :--------- | :--------: | ---------: |\n| Cell       | Markdown   |    Start   |      123.0 |\n| Content    | Grid       |  Complete  |        8.1 |  \n## With special character:  \n```js  \nconst MG = require(\"markdown-grid\");\nconst mg = MG({\n    \"columns\": [{\n        \"name\": \"Name\",\n        \"width\": 15\n    }, {\n        \"name\": \"Character\",\n        \"align\": \"center\"\n    }],\n    \"rows\": [\n        [\"Backtick\", \"`\"],\n        [\"Pipe\", \"|\"],\n        [\"Escaped Pipes\", \"\\\\||\\\\|\"],\n        [\"中文\", \"✅\"]\n    ]\n});\n\nconsole.log(mg);  \n\n|Name           |Character|\n|---------------|:-------:|\n|Backtick       |    `    |\n|Pipe           |    \\|   |\n|Escaped Pipes  |  \\|\\|\\| |\n|中文           |    ✅   |  \n```  \n|Name           |Character|\n|---------------|:-------:|\n|Backtick       |    `    |\n|Pipe           |    \\|   |\n|Escaped Pipes  |  \\|\\|\\| |\n|中文           |    ✅   |  \n## With links, images, Codes and formatting:  \n```js  \nconst MG = require(\"markdown-grid\");\nconst mg = MG({\n    \"columns\": [\"Name\", \"Version\", \"Install\", \"Description\"],\n    \"rows\": [\n        [\"[markdown-grid](https://github.com/cenfun/markdown-grid)\", \"![npm](https://badgen.net/npm/v/markdown-grid)\", \"`npm i markdown-grid`\", \"Generating a **Markdown** *Grid*\"],\n        [\"[console-grid](https://github.com/cenfun/console-grid)\", \"![npm](https://badgen.net/npm/v/console-grid)\", \"`npm i console-grid`\", \"Log a *Grid* in **Console**\"]\n    ]\n});\n\nconsole.log(mg);  \n\n|Name|Version|Install|Description|\n|----|-------|-------|-----------|\n|[markdown-grid](https://github.com/cenfun/markdown-grid)|![npm](https://badgen.net/npm/v/markdown-grid)|`npm i markdown-grid`|Generating a **Markdown** *Grid*|\n|[console-grid](https://github.com/cenfun/console-grid)|![npm](https://badgen.net/npm/v/console-grid)|`npm i console-grid`|Log a *Grid* in **Console**|  \n```  \n|Name|Version|Install|Description|\n|----|-------|-------|-----------|\n|[markdown-grid](https://github.com/cenfun/markdown-grid)|![npm](https://badgen.net/npm/v/markdown-grid)|`npm i markdown-grid`|Generating a **Markdown** *Grid*|\n|[console-grid](https://github.com/cenfun/console-grid)|![npm](https://badgen.net/npm/v/console-grid)|`npm i console-grid`|Log a *Grid* in **Console**|\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenfun%2Fmarkdown-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcenfun%2Fmarkdown-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenfun%2Fmarkdown-grid/lists"}