Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display Table in README.md file in Github?

I want to display a table in readme.md file. I read GitHub Flavored Markdown and followed what it said. So this is my table:

| Attempt | #1 | #2 | #3 | #4 | #5 | #6 | #7 | #8 | #9 | #10 | #11 | #12 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | Seconds | 301 | 283 | 290 | 286 | 289 | 285 | 287 | 287 | 272 | 276 | 269 | 254 | 

However, I don't see any table and result looks like:

enter image description here

like image 960
Hesam Avatar asked Sep 07 '16 19:09

Hesam


People also ask

How do I add a table to a README.md in GitHub?

You can create tables by assembling a list of words and dividing them with hyphens - (for the first row), and then separating each column with a pipe | . The final example is not correct because you need at least 3 hyphens as the documentation says. Great answer, thank you.

How do I insert a table in markdown?

Tables. To add a table, use three or more hyphens ( --- ) to create each column's header, and use pipes ( | ) to separate each column. For compatibility, you should also add a pipe on either end of the row. Cell widths can vary, as shown below.


1 Answers

You need to see documentation again. You can see this cheatsheet

In your case you need to make second line like in example below:

Attempt | #1 | #2 | #3 | #4 | #5 | #6 | #7 | #8 | #9 | #10 | #11 --- | --- | --- | --- |--- |--- |--- |--- |--- |--- |--- |--- Seconds | 301 | 283 | 290 | 286 | 289 | 285 | 287 | 287 | 272 | 276 | 269 

difference between this code and your code in repo is that second line with separator has same columns as header. After that this table will be shown

like image 147
Spell Avatar answered Oct 13 '22 06:10

Spell