Skip to content

Commit

Permalink
Add "flow" tablefmt which doesn't do any formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
elric1 committed Mar 4, 2024
1 parent 70859a6 commit d976213
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tabulate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ def escape_empty(val):
with_header_hide=["lineabove", "linebelow"],
),
"plain": TableFormat(),
"flow": TableFormat(
align_columns=False,
elide_empty_columns=True,
),
"grid": TableFormat(
lineabove=Line("+", "-", "+", "+"),
linebelowheader=Line("+", "=", "+", "+"),
Expand Down Expand Up @@ -1639,6 +1643,14 @@ def tabulate(
eggs 451
---- --------
"flow" applies no formatting and outputs each column stripped of
leading and trailing whitespace only putting whitespace between
non-empty columns.
>>> print(tabulate([["spam", " ", 41.9999], ["eggs", "a", "451.0"]], tablefmt="flow"))
spam 41.9999
eggs a 451
"grid" is similar to tables produced by Emacs table.el package or
Pandoc grid_tables:
Expand Down

0 comments on commit d976213

Please sign in to comment.