13

I must use the pipe (|) symbol in a table cell. How can I do that? Is there an escape character for it?

For example:

|Code |Comment   |
|-----|----------|
|a | b|Comment 1 |

Table:

Code Comment
a b

But I want:

Enter image description here

3 Answers 3

16

Escape it with a backslash? That works for many things in Markdown. Alternatively, use one of the HTML entities for the pipe character, e.g. | (or the more meaningful | as mentioned by @GalaxyCat105).

The following Markdown:

|foo|bar   |
|---|------|
|\| |||

produces this:

foo bar
| |
7

As the other answers have mentioned, you could escape it with a backslash, which is probably a better solution than mine, but you could also use the HTML entities | or | in place of the pipe character.

|Code  |Comment    |
|------|-----------|
|a | b | Comment 1 |
Code Comment
a | b Comment 1
4

The escape character you're looking for is a backslash:

|Code     |Comment    |
|---------|-----------|
| a \| b  | Comment 1 |

This gives:

Code Comment
a | b Comment 1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .