Skip to content

feature: Limit the width of my table based on the width of the console #290

@Adamou02

Description

@Adamou02

Description

Error occurs when I print a table larger than my console output.

image

Problem, I do not know in advance the number of columns in my tabulate table

Expected behavior

Actually, I have this line :

print(tabulate(data_results, headers="keys", tablefmt="fancy_grid", maxcolwidths=30, showindex=False))

I would like to replace the maxcolwidths=30 with maxcolwidths='automatic'.

This flag will adapt the size of the columns according to the formula console width / number of columns

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions