Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ format:

```pycon
>>> print(tabulate(table, headers, tablefmt="asciidoc"))
[cols="8<,7>",options="header"]
[cols="<8,>7",options="header"]
|====
| item | qty
| spam | 42
Expand Down
2 changes: 1 addition & 1 deletion tabulate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def make_header_line(is_header, colwidths, colaligns):
colwidths, [alignment[colalign] for colalign in colaligns]
)
asciidoc_column_specifiers = [
f"{width:d}{align}" for width, align in asciidoc_alignments
f"{align}{width:d}" for width, align in asciidoc_alignments
]
header_list = ['cols="' + (",".join(asciidoc_column_specifiers)) + '"']

Expand Down
4 changes: 2 additions & 2 deletions test/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,7 @@ def test_asciidoc():
"Output: asciidoc with headers"
expected = "\n".join(
[
'[cols="11<,11>",options="header"]',
'[cols="<11,>11",options="header"]',
"|====",
"| strings | numbers ",
"| spam | 41.9999 ",
Expand All @@ -2117,7 +2117,7 @@ def test_asciidoc_headerless():
"Output: asciidoc without headers"
expected = "\n".join(
[
'[cols="6<,10>"]',
'[cols="<6,>10"]',
"|====",
"| spam | 41.9999 ",
"| eggs | 451 ",
Expand Down
Loading