# Setup standard values for PrettyTables

**URL:** https://discourse.julialang.org/t/setup-standard-values-for-prettytables/31693
**Category:** Visualization
**Tags:** prettytables
**Created:** [November 30, 2019, 2:43pm UTC](https://discourse.julialang.org/t/setup-standard-values-for-prettytables/31693 "2019-11-30T14:43:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)
#### Post date: [November 30, 2019, 2:43pm UTC](https://discourse.julialang.org/t/setup-standard-values-for-prettytables/31693/1 "2019-11-30T14:43:05Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [November 30, 2019, 3:38pm UTC](https://discourse.julialang.org/t/setup-standard-values-for-prettytables/31693/2 "2019-11-30T15:38:23Z")

</div>

write a closure

```julia
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.

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [November 30, 2019, 3:56pm UTC](https://discourse.julialang.org/t/setup-standard-values-for-prettytables/31693/3 "2019-11-30T15:56:08Z")

</div>

Use `@ptconf`, described a bit [here](https://ronisbr.github.io/PrettyTables.jl/stable/man/usage/#Helpers-1)

---

<div class="post-metadata">

### Author: ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)
#### Post date: [November 30, 2019, 8:11pm UTC](https://discourse.julialang.org/t/setup-standard-values-for-prettytables/31693/4 "2019-11-30T20:11:33Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)
#### Post date: [November 30, 2019, 8:12pm UTC](https://discourse.julialang.org/t/setup-standard-values-for-prettytables/31693/5 "2019-11-30T20:12:13Z")

</div>

Somehow I just missed it in the manual.

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [November 30, 2019, 9:51pm UTC](https://discourse.julialang.org/t/setup-standard-values-for-prettytables/31693/6 "2019-11-30T21:51:01Z")

</div>

> [@Usor](#):
>
> 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 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.

---

<div class="post-metadata">

### Author: ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)
#### Post date: [December 1, 2019, 5:57pm UTC](https://discourse.julialang.org/t/setup-standard-values-for-prettytables/31693/7 "2019-12-01T17:57:53Z")

</div>

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