Skip to content
trentm edited this page Sep 18, 2014 · 1 revision

tables extra

The tables extra provides support for tables using the same format as GFM and PHP-Markdown Extra. For example, this text:

| Header 1 | *Header* 2 |
| -------- | -------- |
| `Cell 1` | [Cell 2](http://example.com) link |
| Cell 3 | **Cell 4** |

Becomes this:

<table>
<thead>
<tr>
  <th>Header 1</th>
  <th><em>Header</em> 2</th>
</tr>
</thead>
<tbody>
<tr>
  <td><code>Cell 1</code></td>
  <td><a href="http://example.com">Cell 2</a> link</td>
</tr>
<tr>
  <td>Cell 3</td>
  <td><strong>Cell 4</strong></td>
</tr>
</tbody>
</table>

command-line usage

$ python markdown2.py -x tables FOO.txt

module usage

>>> markdown2.markdown(text, extras=["tables"])

Discussion

See also the wiki-tables alternative table format (from Google Code wikis).

(Return to Extras page.)