code block inside table row in Markdown

As others have pointed out, you’ll have to use HTML <table> tags to create the table. It is possible however to format the contents of the table cells using Markdown only

Markdown syntax within HTML blocks works if you leave extra blank lines around the HTML tags: one after the <td> and one before the </td> otherwise the Markdown inside won’t be parsed! This creates a new <p> paragraph where Markdown parsing is re-enabled inside the table cells.

<table>
<tr>
<td> Status </td> <td> Response </td>
</tr>
<tr>
<td> 200 </td>
<td>

^ Extra blank line above!
```json
json
{
    "id": 10,
    "username": "alanpartridge",
    "email": "alan@alan.com",
    "password_hash": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.CPCWCZsyqqa8./whhfzBZydX7yvahHS",
    "password_salt": "$2a$10$uhUIUmVWVnrBWx9rrDWhS.",
    "created_at": "2015-02-14T20:45:26.433Z",
    "updated_at": "2015-02-14T20:45:26.540Z"
}
```
V Extra blank line below!

</td>
</tr>
<tr>
<td> 400 </td>
<td>

**Markdown** _here_. (Blank lines needed before and after!)

</td>
</tr>
</table>

Preview image of the table created with the code above on GitHub

(If you want to fix the bad vertical alignment between “400” and “Markdown here”, add blank lines around the “400” too, which will wrap that in a <p> as well.)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)