Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to show "||" operator in a Markdown table?

I’m trying to show || in a GitHub readme page, but these | are used for creating columns in the table. How can I use this || so it doesn’t mean a column?

op dec
&& AND
OR

I tried \ before the | character, but it still didn’t work.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need an escaping backslash (\) before each pipe character (any un-escaped pipe would be treated as part of the table), like so:

| Operator | Description |
|----------|-------------|
| &&       | AND         |
| \|\|     | OR          |

Result:

Operator Description
&& AND
|| OR

Although I’d suggest marking them with inline code blocks:

Markdown:

| Operator | Description |
|----------|-------------|
| `&&`     | AND         |
| `\|\|`   | OR          |

(It looks wrong on StackOverflow, but works correctly with GitHub’s parser.)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading