geändert: README.md

geändert:       pyproject.toml
	geändert:       src/text_table/_core.py
This commit is contained in:
2026-02-11 19:23:17 +01:00
parent a03fdeb5df
commit 5d9648779f
3 changed files with 11 additions and 1 deletions
+3
View File
@@ -17,6 +17,9 @@ pip install text-table --index-url https://jcloud-services.ddns.net/simple/
## Changelog
### Version 0.1.4
- Better handling of empty tables
### Version 0.1.3
- Added support for objects with custom length and correct formatting of these
+1 -1
View File
@@ -4,6 +4,6 @@ build-backend = "setuptools.build_meta"
[project]
name = "text_table"
version = "0.1.3"
version = "0.1.4"
description = "A simple library for creating text tables."
readme = "README.md"
+7
View File
@@ -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])}'''