### Install markdown-table with npm Source: https://github.com/wooorm/markdown-table/blob/main/readme.md Installs the markdown-table package using the npm package manager for Node.js environments. ```Shell npm install markdown-table ``` -------------------------------- ### Generating Markdown Table (Default) Source: https://github.com/wooorm/markdown-table/blob/main/readme.md Demonstrates generating a markdown table using `markdownTable` with default options, showing how alignment can be affected by multi-byte characters or emoji. ```js markdownTable([ ['Alpha', 'Bravo'], ['δΈ­ζ–‡', 'Charlie'], ['πŸ‘©β€β€οΈβ€πŸ‘©', 'Delta'] ]) ``` -------------------------------- ### Import markdown-table in Deno Source: https://github.com/wooorm/markdown-table/blob/main/readme.md Imports the markdownTable function from the markdown-table package using esm.sh for use in Deno. ```JavaScript import {markdownTable} from 'https://esm.sh/markdown-table@3' ``` -------------------------------- ### Import markdown-table in Browser Source: https://github.com/wooorm/markdown-table/blob/main/readme.md Imports the markdownTable function from the markdown-table package using esm.sh with bundling for use directly in web browsers via a script tag. ```HTML ``` -------------------------------- ### Basic markdownTable Usage Source: https://github.com/wooorm/markdown-table/blob/main/readme.md Demonstrates the basic usage of the markdownTable function with a simple 2x3 data matrix, generating a markdown table with default left alignment. ```JavaScript import {markdownTable} from 'markdown-table' markdownTable([ ['Branch', 'Commit'], ['main', '0123456789abcdef'], ['staging', 'fedcba9876543210'] ]) ``` -------------------------------- ### Generating Markdown Table (with stringLength) Source: https://github.com/wooorm/markdown-table/blob/main/readme.md Demonstrates generating a markdown table using `markdownTable` with the `stringLength` option set to the `string-width` function, which correctly calculates the visible width of characters. ```js import stringWidth from 'string-width' markdownTable( [ ['Alpha', 'Bravo'], ['δΈ­ζ–‡', 'Charlie'], ['πŸ‘©β€β€οΈβ€πŸ‘©', 'Delta'] ], {stringLength: stringWidth} ) ``` -------------------------------- ### markdownTable Usage with Alignment Source: https://github.com/wooorm/markdown-table/blob/main/readme.md Shows how to use the markdownTable function with the 'align' option to specify different alignments (left, center, right) for columns. ```JavaScript markdownTable( [ ['Beep', 'No.', 'Boop'], ['beep', '1024', 'xyz'], ['boop', '3388450', 'tuv'], ['foo', '10106', 'qrstuv'], ['bar', '45', 'lmno'] ], {align: ['l', 'c', 'r']} ) ``` -------------------------------- ### Default Markdown Table Output Source: https://github.com/wooorm/markdown-table/blob/main/readme.md The resulting markdown output when generating a table with default `markdownTable` options, illustrating the misalignment issue. ```markdown | Alpha | Bravo | | - | - | | δΈ­ζ–‡ | Charlie | | πŸ‘©β€β€οΈβ€πŸ‘© | Delta | ``` -------------------------------- ### Markdown Table Output (with stringLength) Source: https://github.com/wooorm/markdown-table/blob/main/readme.md The resulting markdown output when generating a table using `markdownTable` with the `stringLength` option, showing improved alignment for multi-byte characters and emoji. ```markdown | Alpha | Bravo | | ----- | ------- | | δΈ­ζ–‡ | Charlie | | πŸ‘©β€β€οΈβ€πŸ‘© | Delta | ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.