Skip to content
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

feat: Add cell_padding configurable option #52

Merged
merged 13 commits into from
Oct 31, 2022
Merged

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