0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Markdown テーブル内で文字として「|」を使用する

Last updated at Posted at 2020-01-21

目的

  • Markdownのテーブルにて文字としてセル内に|を記載する方法をまとめる。

結論

  • 表示して欲しい|の前に\を記載する。

考え方

  • Markdown内ではテーブルを作成する際にセルの区切りに|を使用している。
  • そのため|をセル内に記載したくても表示されない。
  • |の様な特殊文字を記載したい際は、特殊文字を通常文字列として扱ってもらう必要がある。
  • そのために用いるのがエスケープ文字\である。
  • エスケープ文字\の後ろは特殊文字だったとしても通常の文字として扱われる。
  • 一文字のエスケープ文字でエスケープできるのは特殊文字一文字のみである。

書き方の例

  • 下記にテーブル内に|を表示させる方法を記載する。

    |データ名1|データ名2|
    |---|---|
    | \| |   |
    

    ↓プレビュー

    データ名1 データ名2
    |
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?