user7862197
user7862197

Reputation:

how to show "|" in table of .md file in github?

I had test "&#124" to express "|" in my github page's .md file 's table. but failed.

It just show "&#124" but no symbol '|",

Could any one help?

I want to show "|" in the table of .md file on github page. Much Thanks

Upvotes: 3

Views: 314

Answers (3)

Njuguna_nc
Njuguna_nc

Reputation: 297

You can use HTML table tags to create a table in md file.

<table style="width:100%">
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>
  <tr>
    <td>Alfreds Futterkiste</td>
    <td>Maria Anders</td>
    <td>Germany</td>
  </tr>
  <tr>
    <td>Centro comercial Moctezuma</td>
    <td>Francisco Chang</td>
    <td>Mexico</td>
  </tr>
</table>

Result

enter image description here

Upvotes: 0

ritesh sangani
ritesh sangani

Reputation: 340

You need to follow &#124 with a semicolon. Here's the example below:

FirstName &#124; LastName | Phone | Email
--- | --- | ---
John &#124; Doe | 99658545 | [email protected]

I have tested on GitHub and it works. I would like to share my experience that initially it did not work because i entered it after a list item. Then I added a blank line by hitting enter just before that table. It worked ! Hope it helps !

Upvotes: 2

Robby Cornelissen
Robby Cornelissen

Reputation: 97150

As noted in the documentation, you need to escape the pipe (|) with a backslash (\):

To include a pipe | as content within your cell, use a \ before the pipe:

| Name     | Character |
| ---      | ---       |
| Backtick | `         |
| Pipe     | \|        |

Upvotes: 1

Related Questions