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.
1
You need an escaping backslash () before each pipe character (any un-escaped pipe would be treated as part of the table), like so:
<code>| Operator | Description |
|----------|-------------|
| && | AND |
| || | OR |
</code>
<code>| Operator | Description |
|----------|-------------|
| && | AND |
| || | OR |
</code>
| Operator | Description |
|----------|-------------|
| && | AND |
| || | OR |
Result:
Operator | Description |
---|---|
&& | AND |
|| | OR |
Although I’d suggest marking them with inline code blocks:
Markdown:
<code>| Operator | Description |
|----------|-------------|
| `&&` | AND |
| `||` | OR |
</code>
<code>| Operator | Description |
|----------|-------------|
| `&&` | AND |
| `||` | OR |
</code>
| Operator | Description |
|----------|-------------|
| `&&` | AND |
| `||` | OR |
(It looks wrong on StackOverflow, but works correctly with GitHub’s parser.)
4