Skip to content

pymdown-multimd-table

A Python-Markdown extension implementing MultiMarkdown 6 extended table syntax, mirroring the feature set of the markdown-it-multimd-table JavaScript plugin.

Features

Standard (always enabled)

Feature Description
Column spanning Empty cells \|\| extend the previous cell
Text alignment :---, :---:, ---: in the separator row
Wrappable columns ---+ in the separator adds class="extend"
Multiple header rows Multiple rows before the separator
Table captions [caption text] or [caption text][label]
Multiple tbody sections Blank line between data rows
Inline Markdown Bold, italic, code, etc. inside cells

Optional (controlled by configuration)

Option Default Description
rowspan false ^^ in a cell merges it with the cell above
multiline false Backslash \ at end of row continues cell content on the next line
headerless false Tables without a header/separator row
multibody true Blank lines between data rows create separate <tbody> elements
autolabel true Auto-generate id from caption text
attr_list false Parse {.class #id key=val} attribute blocks on cells and rows

Quick example

|              | Grouping      ||
| Header       | A             | B             |
| :----------- | :-----------: | ------------: |
| Row 1        | spans         ||
| Row 2        | left          | right         |
Grouping
Header A B
Row 1 spans
Row 2 left right
<table>
<thead>
<tr>
<th style="text-align:left"></th>
<th colspan="2" style="text-align:center">Grouping</th>
</tr>
<tr>
<th style="text-align:left">Header</th>
<th style="text-align:center">A</th>
<th style="text-align:right">B</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">Row 1</td>
<td colspan="2" style="text-align:center">spans</td>
</tr>
<tr>
<td style="text-align:left">Row 2</td>
<td style="text-align:center">left</td>
<td style="text-align:right">right</td>
</tr>
</tbody>
</table>