geändert: README.md
geändert: pyproject.toml geändert: src/text_table/_core.py
This commit is contained in:
@@ -115,6 +115,13 @@ def table(data: Sequence[dict], *, borders: bool = False, border_charset: TableB
|
||||
:rtype: str
|
||||
'''
|
||||
|
||||
any_content = False
|
||||
for col in data:
|
||||
if col:
|
||||
any_content = True
|
||||
if not any_content:
|
||||
return ''
|
||||
|
||||
column_widths = _get_max_widths(data)
|
||||
columns = list(column_widths.keys())
|
||||
table = f'''{(column_space * ' ').join([(c.upper() if uppercase_column_headers else c) + ' ' * (column_widths[c] - len(c)) for c in columns])}'''
|
||||
|
||||
Reference in New Issue
Block a user