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

Print Empty Table if no rows exist #27

Open
PJUllrich opened this issue Dec 16, 2024 · 4 comments
Open

Print Empty Table if no rows exist #27

PJUllrich opened this issue Dec 16, 2024 · 4 comments

Comments

@PJUllrich
Copy link

Hey there, thank you very much for this lovely library!

Small request: Could you always print the table header, even when then table has no rows? Right now, it simply prints an empty row, but that can be confusing because I'd expect at least an empty table. Could be optional as well!

Much thanks in advance!

@hpopp
Copy link
Member

hpopp commented Dec 16, 2024

Thanks for the suggestion! The empty row was an oversight on my part, I’d be fine having it return empty headers by default. You’re more than welcome to open a PR, else I can take a look when I return from traveling.

@PJUllrich
Copy link
Author

Thank you! I probably won't get to it this year anymore, but I'd be happy to have a look in January. But please don't wait for me :)

@hpopp
Copy link
Member

hpopp commented Dec 20, 2024

I took a look, whats the specific use case where you're getting an empty row? Currently it skips printing entirely if the list is empty.

@PJUllrich
Copy link
Author

PJUllrich commented Dec 25, 2024

Hey @hpopp apologies for the late reply. My use-case is printing tables as a terminal output from a CLI/Mix task. It’s confusing if I don’t print a table after a user ran a command, even if the output data is empty. I now handle this myself but it would be nicer to print an empty table instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants