adius adius - 4 months ago 154
Markdown Question

Create table without header in markdown

Is it possible to create a table without a header in markdown?

The HTML would look like this:

<table>
<tr>
<td>Key 1</td>
<td>Value 1</td>
</tr>
<tr>
<td>Key 2</td>
<td>Value 2</td>
</tr>
</table>

Answer

Most markdown parsers don't support tables without headers. That means the separation line for headers is mandatory.

Parsers that do not support tables without headers

  • multimarkdown
  • Maruku: A popuplar implementation in ruby
  • byword: "All tables must begin with one or more rows of headers"
  • PHP Markdown Extra "second line contains a mandatory separator line between the headers and the content"

  • RDiscount Uses PHP Markdown Extra syntax.

  • Github Flavoured Markdown

Parsers that do supports tables without headers.

CSS solution

If you're able to change the CSS of the HTML output you can however leverage the :empty pseudo class to hide an empty header and make it look like there is no header at all.

Comments