scribe icon indicating copy to clipboard operation
scribe copied to clipboard

Print Empty Table if no rows exist

Open PJUllrich opened this issue 11 months ago • 4 comments

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!

PJUllrich avatar Dec 16 '24 14:12 PJUllrich

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.

hpopp avatar Dec 16 '24 15:12 hpopp

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 :)

PJUllrich avatar Dec 17 '24 18:12 PJUllrich

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.

hpopp avatar Dec 20 '24 17:12 hpopp

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.

PJUllrich avatar Dec 25 '24 10:12 PJUllrich