Skip to content

Conversation

DenverCoder1
Copy link
Owner

@DenverCoder1 DenverCoder1 commented Oct 31, 2022

Adds an option to configure the amount of cell padding.

table2ascii(
    header=["#", "G", "H", "R", "S"],
    body=[[1, 2, 3, 4, 5]],
    footer=["A", "B", 1, 2, 3],
    first_col_heading=True,
    cell_padding=0,
)
"""
╔═╦═══════╗
║#║G H R S║
╟─╫───────╢
║1║2 3 4 5║
╟─╫───────╢
║A║B 1 2 3║
╚═╩═══════╝
"""
table2ascii(
    header=["#", "G", "H", "R", "S"],
    body=[[1, 2, 3, 4, 5]],
    footer=["A", "B", 1, 2, 3],
    first_col_heading=True,
    cell_padding=2,
)
"""
╔═════╦═══════════════════════╗
║  #  ║  G     H     R     S  ║
╟─────╫───────────────────────╢
║  1  ║  2     3     4     5  ║
╟─────╫───────────────────────╢
║  A  ║  B     1     2     3  ║
╚═════╩═══════════════════════╝
"""

@DenverCoder1 DenverCoder1 changed the title feat: Add extra_padding option feat: Add cell_padding configurable option Oct 31, 2022
@DenverCoder1 DenverCoder1 added the enhancement New feature or request label Oct 31, 2022
@DenverCoder1 DenverCoder1 merged commit 6d29538 into main Oct 31, 2022
@DenverCoder1 DenverCoder1 deleted the pad_cell-option branch October 31, 2022 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant