Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can one display tables side by side in Github Markdown?

Tags:

For instance, this doesn't work, tables are joined:

| Tables   |      Are      |  Cool |             | Tables   |      Are      |  Cool | |----------|:-------------:|------:|             |----------|:-------------:|------:| | col 1 is |  left-aligned | $1600 |             | col 1 is |  left-aligned | $1600 | | col 2 is |    centered   |   $12 |             | col 2 is |    centered   |   $12 | | col 3 is | right-aligned |    $1 |              
like image 453
igorludi Avatar asked Apr 05 '17 13:04

igorludi


People also ask

Can you make tables in Markdown?

Markdown makes it simple to format text online, such as bold text, and links. You can even make tables with Markdown.

How do I center a table in GitHub?

It is possible to center a table. Essentially, on GitHub the table is already width 100%. You just need to give the tbody enough content for it take up 100% width too. The trick: fill it with spaces.


Video Answer


2 Answers

Space between text marks the beginning and end of particular types of content. Try this:

<table> <tr><th>Table 1 Heading 1 </th><th>Table 1 Heading 2</th></tr> <tr><td>  |Table 1| Middle | Table 2| |--|--|--| |a| not b|and c |  </td><td>  |b|1|2|3|  |--|--|--|--| |a|s|d|f|  </td></tr> </table> 

It will look like this:

two merkdown tables in one html table

like image 119
spacepickle Avatar answered Sep 16 '22 17:09

spacepickle


For GitHub, you can use the below format for displaying two tables side by side. This is the way I usually do it:

|Table 1|Table 2| |--|--| |<table> <tr><th>Table 1 Heading 1</th><th>Table 1 Heading 2</th></tr><tr><td>Row 1 Column 1</td><td>Row 1 Column 2</td></tr> </table>| <table> <tr><th>Table 2 Heading 1</th><th>Table 2 Heading 2</th></tr><tr><td>Row 1 Column 1</td><td>Row 1 Column 2</td></tr> </table>| 

You can see the output here.

Note: Please do not use new line or it will not work.

like image 39
Jagrut Avatar answered Sep 17 '22 17:09

Jagrut