Skip to content

Commit 813edee

Browse files
committed
update README and doctest descriptions of colon_grid introduced in pr astanin#341
1 parent 7adda92 commit 813edee

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,22 @@ corresponds to the `pipe` format without alignment colons:
335335
╘════════╧═══════╛
336336
```
337337

338+
`colon_grid` is similar to `grid` but uses colons only to define
339+
columnwise content alignment , without whitespace padding,
340+
similar the alignment specification of Pandoc `grid_tables`:
341+
342+
>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
343+
... ["strings", "numbers"], "colon_grid",
344+
... colalign=["right", "left"]))
345+
+-----------+-----------+
346+
| strings | numbers |
347+
+==========:+:==========+
348+
| spam | 41.9999 |
349+
+-----------+-----------+
350+
| eggs | 451 |
351+
+-----------+-----------+
352+
353+
338354
`outline` is the same as the `grid` format but doesn't draw lines between rows:
339355

340356
>>> print(tabulate(table, headers, tablefmt="outline"))

tabulate/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,8 @@ def tabulate(
18911891
╘═══════════╧═══════════╛
18921892
18931893
"colon_grid" is similar to "grid" but uses colons only to define
1894-
columnwise content alignment, with no whitespace padding:
1894+
columnwise content alignment, without whitespace padding,
1895+
similar to the alignment specification of Pandoc `grid_tables`:
18951896
18961897
>>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]],
18971898
... ["strings", "numbers"], "colon_grid"))

0 commit comments

Comments
 (0)