diff options
-rw-r--r-- | markdown/extensions/tables.py | 1 | ||||
-rw-r--r-- | tests/extensions/extra/tables.html | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/markdown/extensions/tables.py b/markdown/extensions/tables.py index a19018e..8c11739 100644 --- a/markdown/extensions/tables.py +++ b/markdown/extensions/tables.py @@ -45,6 +45,7 @@ class TableProcessor(BlockProcessor): # Get alignment of columns align = [] for c in self._split_row(seperator, border): + c = c.strip() if c.startswith(':') and c.endswith(':'): align.append('center') elif c.startswith(':'): diff --git a/tests/extensions/extra/tables.html b/tests/extensions/extra/tables.html index 783c205..b5c08be 100644 --- a/tests/extensions/extra/tables.html +++ b/tests/extensions/extra/tables.html @@ -38,21 +38,21 @@ <table> <thead> <tr> -<th>Item</th> +<th align="left">Item</th> <th align="right">Value</th> </tr> </thead> <tbody> <tr> -<td>Computer</td> +<td align="left">Computer</td> <td align="right">$1600</td> </tr> <tr> -<td>Phone</td> +<td align="left">Phone</td> <td align="right">$12</td> </tr> <tr> -<td>Pipe</td> +<td align="left">Pipe</td> <td align="right">$1</td> </tr> </tbody> |