How to Create a Table without a Header in Markdown

avatar
Borislav Hadzhiev

Last updated: Apr 5, 2024
3 min

banner

# Table of Contents

  1. How to Create a Table without a Header in Markdown
  2. Create a table without a header in markdown using HTML

# How to Create a Table without a Header in Markdown

There are multiple ways to create a table without a header in markdown.

For example, you could leave the header fields empty.

README.md
| | | | | ------- | ------- | ------- | | Value A | Value B | Value C | | Value E | Value F | Value G |

table without headers in markdown

All of the screenshots in this article use GitHub-flavored markdown but the examples work in vanilla markdown and Jupyter Notebook markdown as well.

You can also use a comment in the place of the headers.

README.md
| <!-- --> | <!-- --> | <!-- --> | | -------- | -------- | -------- | | Value A | Value B | Value C | | Value E | Value F | Value G |

table without headers in markdown

You can also use the &nbsp; (non-breaking space) character sequence when leaving the headers empty.

README.md
| &nbsp; | &nbsp; | &nbsp; | | ------- | ------- | ------- | | Value A | Value B | Value C | | Value E | Value F | Value G |

using nbsp character instead

You could also use a simple span element to achieve the same result.

README.md
| <span/> | <span/> | <span/> | | ------- | ------- | ------- | | Value A | Value B | Value C | | Value E | Value F | Value G |

using nbsp character instead

Since the header text in your table gets bolded automatically, you can also create a table without a header by bolding the text in all cells.

README.md
| Some | Header | Text | Here | | ----------- | ----------- | ----------- | ----------- | | **Value A** | **Value B** | **Value C** | **Value D** | | **Value E** | **Value F** | **Value G** | **Value H** |

simulate table without headers by bolding cell text

If you look closely, you might also see that by default, the header text is center-aligned.

You can use a colon : to align the header text to the left so it doesn't stand out.

README.md
| Some | Header | Text | Here | | :---------- | :---------- | :---------- | :---------- | | **Value A** | **Value B** | **Value C** | **Value D** | | **Value E** | **Value F** | **Value G** | **Value H** |

table without headers centered left

# Create a table without a header in markdown using HTML

You can also use HTML to create a table without a header.

README.md
<table> <tr> <td>Key 1</td> <td>Value 1</td> </tr> <tr> <td>Key 2</td> <td>Value 2</td> </tr> <tr> <td>Key 3</td> <td>Value 3</td> </tr> </table>

create table without headers using html

I've also written a detailed guide on how to write lists inside a table in markdown.

If you use vanilla markdown or any other type of markdown where you can apply CSS, you can also use a style tag to hide the headers.

README.md
<style> th { display: none; } thead th:empty { display: none; } </style> <table> <tr> <th>First</th> <th>Second</th> <th>Third</th> </tr> <tr> <td>Key 1</td> <td>Value 1</td> </tr> <tr> <td>Key 2</td> <td>Value 2</td> </tr> <tr> <td>Key 3</td> <td>Value 3</td> </tr> </table>

hide table headers using css

Note that this wouldn't work in GitHub markdown because GitHub automatically strips the style tags.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.