Skip to content

Commit

Permalink
Revert "Zeroed padding when maxcolwidths/maxheadercolwidths (Fixes as…
Browse files Browse the repository at this point in the history
…tanin#354)"

This reverts commit e11e854.
  • Loading branch information
09s23jf038 committed Jan 28, 2025
1 parent e11e854 commit 8e5af6f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tabulate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2203,7 +2203,7 @@ def tabulate(
Tabulate will, by default, set the width of each column to the length of the
longest element in that column. However, in situations where fields are expected
to reasonably be too long to look good as a single line, tabulate can help automate
word wrapping long fields for you. Use the parameter `maxcolwidths` to provide a
word wrapping long fields for you. Use the parameter `maxcolwidth` to provide a
list of maximal column widths
>>> print(tabulate( \
Expand All @@ -2221,7 +2221,7 @@ def tabulate(
| | | better if it is wrapped a bit |
+------------+------------+-------------------------------+
Header column width can be specified in a similar way using `maxheadercolwidths`
Header column width can be specified in a similar way using `maxheadercolwidth`
"""

Expand All @@ -2234,7 +2234,6 @@ def tabulate(
list_of_lists, separating_lines = _remove_separating_lines(list_of_lists)

if maxcolwidths is not None:
MIN_PADDING = 0
if type(maxcolwidths) is tuple: # Check if tuple, convert to list if so
maxcolwidths = list(maxcolwidths)
if len(list_of_lists):
Expand All @@ -2252,7 +2251,6 @@ def tabulate(
)

if maxheadercolwidths is not None:
MIN_PADDING = 0
num_cols = len(list_of_lists[0])
if isinstance(maxheadercolwidths, int): # Expand scalar for all columns
maxheadercolwidths = _expand_iterable(
Expand Down

0 comments on commit 8e5af6f

Please sign in to comment.