You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to set a max number of items before the script draws a second table to the right of the first one?
If I have say, 50 items which are being listed in fancy_grid mode, ideally I want to display only 15 to 20 before my terminal runs out of vertical space.
So being able to give a parameter like "max_list_length=20" would be a nice option to have.
Thank you!
The text was updated successfully, but these errors were encountered:
r-bhikhie
changed the title
Feature request: Set max list lenght when using fancy_grid
Feature request: Set max list length when using fancy_grid
May 13, 2020
This library is used in all sorts of contexts, interactive and non-interactive. If you want to paginate output, extract a slice of your data and pass it to tabulate() function.
So let's say you have a data with 50 rows, page size 5, and want to print the 4th page (0-indexed):
>>> data = [["text", i] for i in range(1, 50)]
>>> pagesize = 5
>>> print(tabulate(data[pagesize*3:pagesize*3+pagesize]))
---- --
text 16
text 17
text 18
text 19
text 20
---- --
The burden of getting user input to go to the next/previous page is out of scope of this library.
Is there any way to set a max number of items before the script draws a second table to the right of the first one?
If I have say, 50 items which are being listed in fancy_grid mode, ideally I want to display only 15 to 20 before my terminal runs out of vertical space.
So being able to give a parameter like "max_list_length=20" would be a nice option to have.
Thank you!
The text was updated successfully, but these errors were encountered: