/copy-excel-paste-markdown

Copy a table in Excel (or other spreadsheet programs) and paste it as a Markdown table

Primary LanguageJavaScriptMIT LicenseMIT

Copy Excel Paste Markdown

Copy a table in Excel (or other spreadsheet programs) and paste it as a Markdown table.

demo

Column Alignments

You can optionally specify column alignment information by prepending one of the following to the column heading names in Excel:

  • ^c - center alignment
  • ^r - right alignment
  • ^l - left alignment (the default)

For example: enter the following in Excel to right-align the second column and center-align the third column:

animal ^rweight ^ccolor
dog 30lb tan
dog 85lb black
cat 18lb calico

This will produce the following markdown table when pasted:

| animal | weight | color  |
|--------|-------:|:------:|
| dog    | 30lb   | tan    |
| dog    | 85lb   | black  |
| cat    | 18lb   | calico |