Markdown: Table
Table#
Classic syntax#
To define a table, use the following rules:
- Separate columns with vertical bars (|)
- Insert vertical bars (|) at both ends of the table
- Separate column title with its content, with a demarcation line containing at least 3 hyphens characters (-)
Markdown | HTML | Rendering | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
| <table>
<thead>
<tr>
<th>Variable</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
<td>1</td>
<td>Integer</td>
</tr>
<tr>
<td>B</td>
<td>2</td>
<td></td>
</tr>
</tbody>
</table> |
| |||||||||
| <table>
<thead>
<tr>
<th>Variable</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
<td>1</td>
<td>Integer</td>
</tr>
<tr>
<td>B</td>
<td>2</td>
<td></td>
</tr>
</tbody>
</table> |
|
To easily create tables, it is possible to use online table generators such as Markdown Tables Generator
in order to directly get the table markdown code.
Warning, it is possible to format the text of an array using emphasis, link or code fragment. However, it is not possible to use more complex syntaxes such as code block, title, list, image or horizontal rule.
Alignment#
To align a column content, add a colon character (:) to the hyphens of the demarcation line on the desired alignment side (on both sides to make the content centered).
Markdown | HTML | Rendering | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
| <table>
<thead>
<tr>
<th align="left">Variable</th>
<th align="center">Value</th>
<th align="right">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">A</td>
<td align="center">1</td>
<td align="right">Integer</td>
</tr>
<tr>
<td align="left">B</td>
<td align="center">2</td>
<td align="right"></td>
</tr>
</tbody>
</table> |
| |||||||||
| <table>
<thead>
<tr>
<th align="left">Variable</th>
<th align="center">Value</th>
<th align="right">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">A</td>
<td align="center">1</td>
<td align="right">Integer</td>
</tr>
<tr>
<td align="left">B</td>
<td align="center">2</td>
<td align="right"></td>
</tr>
</tbody>
</table> |
|