Setup standard values for PrettyTables

I didn’t see any of it in the manual. You tell me: is there a way to set standard values for PrettyTables?

For example, you always want blue borders, or always a simple layout, and so on.

If you merely want some quick depiction of a DataFrame, which is then always prettier with PrettyTables, it might become tedious without such values set.

write a closure

function my_pretty_table(df)
    prett_table(df; bordercolor = :blue)
end

Also I’m not sure a pretty_table is always prettier. DataFrames makes sure all numbers are displayed compactly, which is a real benefit.

1 Like

Use @ptconf, described a bit here

2 Likes

Yeah, I thought of a function too, but was hoping for something else. I believe @kevbonham found it.

And I agree that the standard printing of DataFrames is nice and compact and so very functional. I was wondering if it was really worth the effor to learn and use PrettyTables. Though PrettyTables is obviously prettier and less functional relatively.

I think it would be nice if DataFrames were changed to have the same compactness but with prettier default printing, but I am merely wishing.

1 Like

Somehow I just missed it in the manual.

I think if you’re just using it for yourself at the REPL, maybe not necessary. But if you’re doing a notebook for presentation to others, it’s really great. I recently set it up so that it prints a random set of 15 rows, rather than the top, which is often quite useful.

1 Like

Yes, that’s more or less what I thought too. Functionally, like @pdeffebach also mentioned, standard printing is very good.