Search code examples
markdowngithub-flavored-markdown

Commenting out a table row


Is it possible to comment out a table row in (github-flavoured) markdown?

|   ID    |              Info               |
| ------- | ------------------------------- |
| 1       | I want to keep this row         |
| 2       | This row must be commented out! |
| 3       | I want to keep this row         |

It doesn't seem to work with HTML comments, the rows beneath the commented row will not be recognized as table rows anymore. (example gist)


Solution

  • No, it is not possible to comment out a table row in (github-flavoured) Markdown. In fact the spec explicitly states:

    The table is broken at the first empty line, or beginning of another block-level structure

    Of course, an HTML comment is "another block-level structure." Therefore, the comment ends the table. At best, any addition table rows would be seen as a separate table. However, as they do not have a header attached to them, they do not constitute a complete table and therefore are not seen as rows.