diff --git a/tabulate/__init__.py b/tabulate/__init__.py index 5589c11..fe148b0 100644 --- a/tabulate/__init__.py +++ b/tabulate/__init__.py @@ -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("+", "=", "+", "+"), @@ -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: