Skip to content

Fix Table.to_text() sizing #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2025
Merged
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 boltons/tableutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def to_text(self, with_headers=True, maxlen=None):
text_data = [[to_text(cell, maxlen=maxlen) for cell in row]
for row in self._data]
for idx in range(self._width):
cur_widths = [len(cur) for cur in text_data]
cur_widths = [len(row[idx]) for row in text_data]
if with_headers:
cur_widths.append(len(to_text(headers[idx], maxlen=maxlen)))
widths.append(max(cur_widths))
Expand Down