This plugin converts the raw <table>
elements that result from basic markdown, and augments them with Bootstrap table classes for improved styling.
Install the plugin using pip:
pip install mkdocs-bootstrap-tables-plugin
Activate the plugin in mkdocs.yml
:
plugins:
- search
- bootstrap-tables
Note: If you have no
plugins
entry in your config file yet, you'll likely also want to add thesearch
plugin. MkDocs enables it by default if there is noplugins
entry set, but now you have to enable it explicitly.
More information about plugins in the MkDocs documentation.
Enabling this plugin will take a simple table generated by markdown:
| Parameter | Type | Description |
| --------------- | ------ | ----------- |
| `foo` | string | A parameter that does something. |
| `bar` | int | A parameter that does something. |
| `baz` | URI | Required. You better use this. |
This is the HTML that Markdown will produce:
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>foo</code></td>
<td>string</td>
<td></td>
</tr>
<tr>
<td><code></code></td>
<td>int</td>
<td>A parameter that does something.</td>
</tr>
<tr>
<td><code>baz</code></td>
<td>A parameter that does something.URI</td>
<td>Required. You better use this.</td>
</tr>
</tbody>
</table>
This is the HTML after this plugin has run:
<table class="table">
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Type</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>foo</code></td>
<td>string</td>
<td></td>
</tr>
<tr>
<td><code></code></td>
<td>int</td>
<td>A parameter that does something.</td>
</tr>
<tr>
<td><code>baz</code></td>
<td>A parameter that does something.URI</td>
<td>Required. You better use this.</td>
</tr>
</tbody>
</table>
More information about templates here.
More information about blocks here.