How to create a table in Markdown
Need to format your information in a convenient way? Let's figure out how to create a table in Markdown document easily and simply. Let's look at useful tools and professional techniques.

Intro
Let’s start by figuring out why tables are needed in markdown documents and look at the most convenient ways to insert a table into a markdown document quickly and easily.
Tables are often used to organize and present information in a clear and concise way. They can be used to display data, compare different values, or show relationships between different pieces of information.
Using tables can also help make your document visually more appealing and easier to read and understand, especially if you have a lot of information to present.
So tables are always useful for organizing information in a way that’s easy to grasp at a glance.
Syntax
As such, there is no syntax for creating tables in pure Markdown. Tables are only supported in certain versions of Markdown, such as Markdown Extra or GitHub Flavored Markdown.
And here you can find documentation from GitHub on organizing information as tables. We can also find support for tables in extended syntax Markdown.
Creating Table
The easiest and fastest way to make a markdown table is to use the Markdown Table Generator or the AnyWayData service.
Using these tools, you can quickly and easily build a table with a nice graphical interface and then you can copy the resulting Markdown text into your file.
On the other hand, the syntax of the Markdown language is simple enough that you can draw tables yourself. It uses pipe or a vertical slash ( | ) to separate cells and a hyphen ( - ) to make a header line.
Here is a simple example of table code:
|
|
Such code will be displayed in the finished document in the following form:
Column 1 | Column 2 | Column 3 |
---|---|---|
Row 1 | Cell 2 | Cell 3 |
Row 2 | Cell 5 | Cell 6 |
Row 3 | Cell 8 | Cell 9 |
Note that if you need to use the vertical line symbol as content inside a cell, you have to write HTML code for that symbol: |
.
|
|
Result:
Column 1 | Column 2 | Column 3 |
---|---|---|
Row 1 | Cell 2 | 👉 | |
Alignment
You can use colons ( : ) to control the alignment of the text in the columns of the table. Notice the colons in the line with the hyphens. The text in the table code is shifted to the left everywhere, but in the result you will see that it is aligned in the direction where we placed the colons.
|
|
In the left column, we only used colons on the left side, so that the text in the entire column aligned to the left. In the middle column, we used colons both on the left and on the right, so that the text in that column is centered. And in the right column, we only put colons on the right side, so the entire text is right-aligned.
Left-Aligned | Center Aligned | Right Aligned |
---|---|---|
Row 1 | Cell 2 | Cell 3 |
Row 2 | Cell 5 | Cell 6 |
Row 3 | Cell 8 | Cell 9 |
Within tables, we can also use some of the markdown formatting we’re used to - links, slanted, bold, or strikethrough text.
|
|
A table with formatted text inside:
Left-Aligned | Center Aligned | Right Aligned |
---|---|---|
Row 1 | Bold | Cell 3 |
Row 2 | Italic | Cell 6 |
Row 3 | Cell 9 | |
Row 3 | Link | Cell 9 |
However, you cannot use headers, block quotes, lists, horizontal delimiters, images, or most other HTML tags within a Markdown table.
No header
Sometimes it is necessary to create a markdown table without a header.
Such a seemingly easy task requires some creativity. This is because most Markdown parsers do not support tables without headers. This means that a header separator is mandatory.
To make a markdown table without a header, use the following trick. Since a header is required anyway, instead of text, just put in special HTML comment code <!-- -->
:
|
|
As a result, we get a table without a header:
Row 1 | Bold | Cell 3 |
Row 2 | Italic | Cell 6 |
Row 3 | Cell 9 |
Note that this works in most cases, but some applications may still display such code incorrectly. On StackOverflow there is a question on this topic and detailed answers describing different options for creating such tables.
Merging
Sometimes we may need even more sophisticated table formatting when we need to combine multiple cells in a table. For example, like this:
Column 1 | Column 2 | Column 3 |
---|---|---|
R1 Text | R2 Text A | R3 Text A |
R3 Text B | ||
R2 Text B | R3 Text C | |
R3 Text D |
Let me say right away that practically no Markdown implementation can do this with standard means impossible. Because according to specification: “if the number of cells in the table is less than the number of cells in the header row, then insert blank cells. If there are more than that, then excess is ignored”.
So the only way to create such a table as above is to use pure HTML code. Example code for the table above:
|
|
Useful
Outro
Although tables are a handy tool for displaying information in Markdown documents, the language syntax itself still only allows you to do basic things when creating tables in documents.
We’ve looked at those basic features and learned how to quickly and easily create a table in a Markdown document. And for complicated cases, we always have good old-fashioned HTML code.
Good luck!
😎