Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tabulate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def _pipe_line_with_colons(colwidths, colaligns):
def _mediawiki_row_with_attrs(separator, cell_values, colwidths, colaligns):
alignment = {
"left": "",
"right": 'align="right"| ',
"center": 'align="center"| ',
"decimal": 'align="right"| ',
"right": 'style="text-align: right;"| ',
"center": 'style="text-align: center;"| ',
"decimal": 'style="text-align: right;"| ',
}
# hard-coded padding _around_ align attribute and value together
# rather than padding parameter which affects only the value
Expand Down Expand Up @@ -1952,11 +1952,11 @@ def tabulate(
{| class="wikitable" style="text-align: left;"
|+ <!-- caption -->
|-
! strings !! align="right"| numbers
! strings !! style="text-align: right;"| numbers
|-
| spam || align="right"| 41.9999
| spam || style="text-align: right;"| 41.9999
|-
| eggs || align="right"| 451
| eggs || style="text-align: right;"| 451
|}

"html" produces HTML markup as an html.escape'd str
Expand Down
10 changes: 5 additions & 5 deletions test/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2322,11 +2322,11 @@ def test_mediawiki():
'{| class="wikitable" style="text-align: left;"',
"|+ <!-- caption -->",
"|-",
'! strings !! align="right"| numbers',
'! strings !! style="text-align: right;"| numbers',
"|-",
'| spam || align="right"| 41.9999',
'| spam || style="text-align: right;"| 41.9999',
"|-",
'| eggs || align="right"| 451',
'| eggs || style="text-align: right;"| 451',
"|}",
]
)
Expand All @@ -2341,9 +2341,9 @@ def test_mediawiki_headerless():
'{| class="wikitable" style="text-align: left;"',
"|+ <!-- caption -->",
"|-",
'| spam || align="right"| 41.9999',
'| spam || style="text-align: right;"| 41.9999',
"|-",
'| eggs || align="right"| 451',
'| eggs || style="text-align: right;"| 451',
"|}",
]
)
Expand Down