
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Plugin to convert Markdown tables (MDAST) to DOCX with support for rich formatting and seamless integration into mdast2docx.
@m2d/table
A plugin that converts Markdown tables into rich, styled Word tables with full alignment, border, and header support.
npm install @m2d/table
pnpm add @m2d/table
yarn add @m2d/table
The @m2d/table
plugin for mdast2docx
renders Markdown tables into Word-compatible tables with customizable layout, alignment, and cell styling using the docx
library.
Automatically handles header rows, borders, shading, cell alignments, and padding — all configurable.
docx.Table
elementsleft
, center
, right
)import { toDocx } from "@m2d/core";
import { tablePlugin } from "@m2d/table";
const plugins = [tablePlugin()];
const buffer = await toDocx(mdastTree, {
plugins,
});
The tablePlugin
accepts an optional configuration object:
tablePlugin({
tableProps: { ... },
rowProps: { ... },
cellProps: { ... },
firstRowProps: { ... },
firstRowCellProps: { ... },
alignments: {
defaultHorizontalAlign: AlignmentType.CENTER,
defaultVerticalAlign: VerticalAlign.CENTER,
preferMdData: true,
},
});
All options override the following sensible defaults:
Property | Default Value |
---|---|
Table Width | 100% (percentage) |
Border Style | SINGLE , size 1 |
Cell Padding | 2–4mm margins (top/bottom/left/right) |
Header Row | Bold with shaded background #b79c2f |
Vertical Alignment | CENTER |
Horizontal Alignment | Based on Markdown or CENTER fallback |
| Name | Age | City |
| :---: | :-: | --------: |
| Alice | 24 | New York |
| Bob | 30 | San Diego |
docx.Table
, docx.TableRow
, docx.TableCell
, and docx.Paragraph
MDAST.align[]
@m2d/core
’s block plugin APInode.type = ""
If you find this useful:
MIT © Mayank Chaudhari
Made with 💖 by Mayank Kumar Chaudhari
FAQs
Plugin to convert Markdown tables (MDAST) to DOCX with support for rich formatting and seamless integration into mdast2docx.
The npm package @m2d/table receives a total of 739 weekly downloads. As such, @m2d/table popularity was classified as not popular.
We found that @m2d/table demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.