ExcelをMarkdownの表にする方法
- 選ぶ
- 決める
- 貼る
GitHubのREADMEや、ドキュメントに、表を入れたい。Markdownの表は、記号が多くて、手で書くと面倒です。Excelの表をHTML・Markdownにする で「Markdownの表」を選ぶと、Excelの表が、そのままMarkdownの表になります。
手順
- 「Excelファイルを選ぶ」で、.xlsx を選びます。
- 「シート」を選び、「形式」で「Markdownの表」を選びます。
- 「変換後」の内容を確かめて、「結果をコピー」を押します。
- READMEやドキュメントに、貼り付けます。
Markdownの表とは
縦線(|)と、ハイフン(-)で、表を表す書き方です。GitHub、Notion、各種ブログやドキュメントツールで使われています。
向いている場面
- GitHubのREADMEに、仕様の一覧を入れる
- 技術ドキュメントに、比較表を入れる
- Markdown対応のメモやブログに、表を貼る
貼り付けたあとの確認
- 表が、正しく表示されているか(プレビューで確認)
- 縦線が、文字の中に入っていないか
- 列の数が、そろっているか
注意
- セルの中に、縦線(|)があると、列がずれることがある
- セルの中の改行は、そのまま表せない場合がある
- 色や罫線は、Markdownの表には含まれない
例
ライブラリの対応表をExcelで作った。Markdownの表にして、READMEに貼り付けると、GitHub上で表として表示された。
つまずきやすい点
- 表が崩れる:セルの中に、縦線や改行がないか確かめる。
- 見出し行が出ない:「1行目を見出しにする」を確かめる。
よくある質問
列の幅は、そろいますか?
表示のときに、自動で調整されます。
まとめ
ExcelからMarkdownの表へ。READMEやドキュメントの表づくりが、すぐできます。
Excelの表をHTML・Markdownにするを使う(無料)あわせて使えるツール
- ExcelをCSV・JSONに変換する:Excelのシートを、CSV・TSV・JSONに変換します。
- WordをHTMLに変換する:Wordの文章を、Webに貼れるHTMLにします。
- CSVとJSONを相互変換する:CSVとJSONを、すぐに相互変換します。
同じツールの、ほかの解説
How to Turn Excel into a Markdown Table
- Choose
- Set
- Paste
You want to put a table in a GitHub README or documentation. Markdown tables have many symbols and are tedious to write by hand. Choosing "Markdown table" in Convert an Excel Table to HTML or Markdown turns an Excel table straight into a Markdown table.
Steps
- Choose an .xlsx with "Choose an Excel file".
- Choose the "Sheet", and under "Format" choose "Markdown table".
- Check the "After conversion" content and press "Copy result".
- Paste into the README or documentation.
What a Markdown table is
A way of writing tables with vertical bars (|) and hyphens (-). Used in GitHub, Notion and various blog and documentation tools.
Good for
- Putting a specification list in a GitHub README
- Putting comparison tables in technical documents
- Pasting tables into Markdown-compatible notes or blogs
Checks after pasting
- Is the table displayed correctly (check in the preview)?
- Are there vertical bars inside the text?
- Do column counts match?
Cautions
- A vertical bar (|) inside a cell can shift the columns
- Line breaks inside cells may not be representable as they are
- Colours and borders aren't included in Markdown tables
Example
Made a library compatibility table in Excel. Turned it into a Markdown table and pasted it into the README, where it displayed as a table on GitHub.
Common stumbling blocks
- The table breaks: check for vertical bars or line breaks in cells.
- No header row: check "Make the first row a header".
Frequently asked questions
Are column widths aligned?
They are adjusted automatically at display time.
Summary
From Excel to Markdown tables. Making tables for READMEs and documents is quick.
Use "Convert an Excel Table to HTML or Markdown" (free)Tools that go well with this
- Convert Excel to CSV or JSON: Convert an Excel sheet to CSV, TSV or JSON.
- Convert Word to HTML: Turn Word text into HTML.
- Convert CSV and JSON: Convert between CSV and JSON instantly.