summaryrefslogtreecommitdiff
path: root/docs/extensions
diff options
context:
space:
mode:
authorGaige B Paulsen <github@gbp.gaige.net>2022-05-05 15:32:07 -0400
committerGitHub <noreply@github.com>2022-05-05 15:32:07 -0400
commit659a43659c6012df8d8ceb4a3681d2ddb1cb7540 (patch)
tree2f523c0b1de1a402141407ef80e22844c71a45c5 /docs/extensions
parentdb98a2632447387cd5c965b324904ee780809b81 (diff)
downloadpython-markdown-659a43659c6012df8d8ceb4a3681d2ddb1cb7540.tar.gz
Update th/td to use style attribute
This allows better interoperation with CSS style sheets, as the align object on the TH is skipped if the css uses 'text-align: inherit' and the previous 'text-align' is used instead (or the default: left). Added an override to restore the original `align` behavior Moved existing tests to the new test infrastructure Added new tests to test the configuration parameter Updated documentation to document the configuration parameter.
Diffstat (limited to 'docs/extensions')
-rw-r--r--docs/extensions/tables.md22
1 files changed, 21 insertions, 1 deletions
diff --git a/docs/extensions/tables.md b/docs/extensions/tables.md
index 30b7636..aaffc09 100644
--- a/docs/extensions/tables.md
+++ b/docs/extensions/tables.md
@@ -58,10 +58,30 @@ Usage
See [Extensions](index.md) for general extension usage. Use `tables` as the
name of the extension.
-This extension does not accept any special configuration options.
+See the [Library Reference](../reference.md#extensions) for information about
+configuring extensions.
+
+The following options are provided to change the default behavior:
+
+* **`use_align_attribute`**: Set to `True` to use `align` instead of an appropriate `style` attribute
+
+ Default: `'False'`
+
A trivial example:
```python
markdown.markdown(some_text, extensions=['tables'])
```
+
+### Examples
+
+For an example, let us suppose that alignment should be controlled by the legacy `align`
+attribute.
+
+```pycon
+>>> from markdown.extensions.tables import TableExtension
+>>> html = markdown.markdown(text,
+... extensions=[TableExtension(use_align_attribute=True)]
+... )
+```