# Help testing PrettyTables v0.10.0

**URL:** https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609
**Category:** Package Announcements
**Created:** [November 5, 2020, 1:54am UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609 "2020-11-05T01:54:41Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [November 5, 2020, 1:54am UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/1 "2020-11-05T01:54:41Z")

</div>

Hi guys!

I just tagged v0.10.0 of [PrettyTables.jl](https://github.com/ronisbr/PrettyTables.jl). It should be available really soon. This is a huge release, with a lot of new features, and, unfortunately, a lot of breaking changes (sorry!). The point of this release is to add all required features so that PrettyTables.jl can become the [default back-end to print DataFrames.jl to text](https://github.com/JuliaData/DataFrames.jl/pull/2429).

I am targeting v1.0 in which the text backend is marked as stable, _i.e._ no more API changes. Hence, I would like, if possible, to hear some feedback about the new features. This is our last time to make breaking changes easily 😃 Bug reports are also very welcome!

Among the new features, the ones I like the most are:

**Markdown rendering inside cells**

````julia
 julia> using Markdown

julia> a = md"""
       # Header

       This is a paragraph.

       ```julia
       function test()
           return 1
       end
       ```
       """;

julia> b = md"""
       This _ **is a bold text that will wrap inside a cell** _
       """;

julia> pretty_table([a b], columns_width = 20, autowrap = true, linebreaks = true)

````

 ![Captura de Tela 2020-11-04 às 22.28.23](https://global.discourse-cdn.com/julialang/original/3X/6/7/6712b335a143e301e7db1ff9bf83a5f315639e7d.png)

**Vertical cropping behavior**

Finally, PrettyTables.jl can now crop the output at the middle instead of just at the bottom:

```julia
pretty_table(rand(100,100), vcrop_mode = :middle)

```

 ![Captura de Tela 2020-11-04 às 22.29.32](https://global.discourse-cdn.com/julialang/original/3X/7/4/742b53ad2709fb116ecafd088b423d37c0580446.jpeg)

**Titles**

We also have title support now:

```julia
julia> pretty_table(rand(10,3), title = "Table title", title_alignment = :c, title_same_width_as_table = true)

```

 ![Captura de Tela 2020-11-04 às 22.30.48](https://global.discourse-cdn.com/julialang/original/3X/0/2/02fea364c15d8b495dfe3566865a00d474e07b92.png)

---

<div class="post-metadata">

### Author: ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)
#### Post date: [November 5, 2020, 5:28am UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/2 "2020-11-05T05:28:36Z")

</div>

PrettyTables.jl is so cool that runs on my RPiZero v1.5.2

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/8/b8897ac51c88d10cc26e2e7adce430c16d83b220.jpeg)

---

<div class="post-metadata">

### Author: ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)
#### Post date: [November 5, 2020, 8:33am UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/3 "2020-11-05T08:33:58Z")

</div>

This is fantastic. Thank you for working on this!

---

<div class="post-metadata">

### Author: ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)
#### Post date: [November 5, 2020, 9:56am UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/4 "2020-11-05T09:56:55Z")

</div>

Looks nice!

How can I use it (with html backend) in Pluto or Jupyter?  
Just calling `pretty_table(df)` prints the text version (in console for Pluto).

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [November 5, 2020, 10:32am UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/5 "2020-11-05T10:32:19Z")

</div>

In this case you just need to switch the backend to HTML. In PrettyTables I do not look for MIME to select the output automatically. So, just call `pretty_table` with `backend = :html`.

---

<div class="post-metadata">

### Author: ![hellemo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hellemo/32/324_2.png) [@hellemo](https://discourse.julialang.org/u/hellemo)
#### Post date: [November 5, 2020, 11:01am UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/6 "2020-11-05T11:01:06Z")

</div>

With Pluto you can do:

`HTML(sprint(io->pretty_table(io,df;backend=:html)))`

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [November 5, 2020, 11:20am UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/7 "2020-11-05T11:20:43Z")

</div>

Nice, in this case you can just pass `String` instead of the `io`: `HTML(pretty_table(String, data, backend = :html)`.

---

<div class="post-metadata">

### Author: ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)
#### Post date: [November 5, 2020, 1:17pm UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/9 "2020-11-05T13:17:40Z")

</div>

Thanks for your help!

```julia
HTML(pretty_table(String, df2; backend=:html))

```

works for me in Pluto, but crops the columns if there are too many.

This code snippet prints all columns with scrollbars:

```julia
HTML("<div style=\"overflow:auto;\">" * pretty_table(String, df2; backend=:html) * "</div>")

```

`vcrop_mode = :middle` does not work for the html-backend, right?  
For display in notebooks, I think it is best to show all columns (per scrollbar) and rows cropped in the middle as default.

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [November 5, 2020, 1:31pm UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/10 "2020-11-05T13:31:09Z")

</div>

Nice, there is a lot of room for improvements in HTML. I really focused the last few months on the text back-end, which is way more difficult. Probably, in HTML, we can do everything using the available features without requiring processing the table itself. For example, one way to avoid cropping is showing scroll bars both horizontally and vertically like you said. However, we may add the vertical cropping mechanism if necessary.

---

<div class="post-metadata">

### Author: ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)
#### Post date: [November 6, 2020, 6:33pm UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/11 "2020-11-06T18:33:15Z")

</div>

It is a great package! I am going to review the documentation and give you my feedback.

One suggestion before the final version, that I have though: It could be possible to have the same Highlighter API that could be used for Latex, Html or Text? In the depth, it could use the current existing LatexHightlighter, HTMLHighlighter, or Highlighter, and considering the backend to use finally one or another? It could be great if that would be possible (I could help you in a couple of weeks if the idea interest you).

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [November 7, 2020, 6:50pm UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/12 "2020-11-07T18:50:13Z")

</div>

> [@dmolina](#):
>
> It is a great package! I am going to review the documentation and give you my feedback.

Thanks! That will help a lot! 🙂

> [@dmolina](#):
>
> One suggestion before the final version, that I have though: It could be possible to have the same Highlighter API that could be used for Latex, Html or Text? In the depth, it could use the current existing LatexHightlighter, HTMLHighlighter, or Highlighter, and considering the backend to use finally one or another? It could be great if that would be possible (I could help you in a couple of weeks if the idea interest you).

Nice suggestion! This seems a very good feature. Do you mind opening an issue?

---

<div class="post-metadata">

### Author: ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)
#### Post date: [November 30, 2020, 10:09pm UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/13 "2020-11-30T22:09:48Z")

</div>

I am printing a DataFrame with `pretty_table(df, nosubheader = true)` and expected not to see the type of each column, but it is still being printed. Is this the correct behavior?

```julia
┌───────────┬──────────────────┬────────────────┬──────────────┬────────────────┐
│ Variable │ Region 1 │ Region 2 │ Region 3 │ Region 4 │
│ String │ String │ String │ String │ String │
├───────────┼──────────────────┼────────────────┼──────────────┼────────────────┤
│ Coeff. x⁰ │ A₀₁ = -88.728 │ A₀₂ = -12.046 │ A₀₃ = 3.248 │ A₀₄ = 0.106 │

```

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [November 30, 2020, 10:23pm UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/14 "2020-11-30T22:23:07Z")

</div>

This is strange. It is working perfectly here:

```julia
julia> df = DataFrame(a = [i == 2 ? missing : 10^i for i = -7:1.:7],
                      b = Int64.(1:1:15),
                      c = [i % 2 == 0 for i = 1:15],
                      d = [i == 2 ? "test" : 10^i for i = -7:1.:7],
                      e = [i == 2 ? -0.0 : i == 3 ? +0.0 : 10^i for i = -7:1.:7])
15×5 DataFrame
 Row │ a b c d e
     │ Float64? Int64 Bool Any Float64
─────┼───────────────────────────────────────────────────
   1 │ 1.0e-7 1 false 1.0e-7 1.0e-7
   2 │ 1.0e-6 2 true 1.0e-6 1.0e-6
   3 │ 1.0e-5 3 false 1.0e-5 1.0e-5
   4 │ 0.0001 4 true 0.0001 0.0001
   5 │ 0.001 5 false 0.001 0.001
   6 │ 0.01 6 true 0.01 0.01
   7 │ 0.1 7 false 0.1 0.1
   8 │ 1.0 8 true 1.0 1.0
   9 │ 10.0 9 false 10.0 10.0
  10 │ missing 10 true test -0.0
  11 │ 1000.0 11 false 1000.0 0.0
  12 │ 10000.0 12 true 10000.0 10000.0
  13 │ 100000.0 13 false 100000.0 100000.0
  14 │ 1.0e6 14 true 1.0e6 1.0e6
  15 │ 1.0e7 15 false 1.0e7 1.0e7

julia> pretty_table(df, nosubheader = true)
┌──────────┬────┬───────┬──────────┬──────────┐
│ a │ b │ c │ d │ e │
├──────────┼────┼───────┼──────────┼──────────┤
│ 1.0e-7 │ 1 │ false │ 1.0e-7 │ 1.0e-7 │
│ 1.0e-6 │ 2 │ true │ 1.0e-6 │ 1.0e-6 │
│ 1.0e-5 │ 3 │ false │ 1.0e-5 │ 1.0e-5 │
│ 0.0001 │ 4 │ true │ 0.0001 │ 0.0001 │
│ 0.001 │ 5 │ false │ 0.001 │ 0.001 │
│ 0.01 │ 6 │ true │ 0.01 │ 0.01 │
│ 0.1 │ 7 │ false │ 0.1 │ 0.1 │
│ 1.0 │ 8 │ true │ 1.0 │ 1.0 │
│ 10.0 │ 9 │ false │ 10.0 │ 10.0 │
│ missing │ 10 │ true │ test │ -0.0 │
│ 1000.0 │ 11 │ false │ 1000.0 │ 0.0 │
│ 10000.0 │ 12 │ true │ 10000.0 │ 10000.0 │
│ 100000.0 │ 13 │ false │ 100000.0 │ 100000.0 │
│ 1.0e6 │ 14 │ true │ 1.0e6 │ 1.0e6 │
│ 1.0e7 │ 15 │ false │ 1.0e7 │ 1.0e7 │
└──────────┴────┴───────┴──────────┴──────────┘

```

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [December 1, 2020, 4:56am UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/15 "2020-12-01T04:56:59Z")

</div>

Late to the party but, man, these really are pretty tables!

---

<div class="post-metadata">

### Author: ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)
#### Post date: [December 1, 2020, 4:12pm UTC](https://discourse.julialang.org/t/help-testing-prettytables-v0-10-0/49609/16 "2020-12-01T16:12:48Z")

</div>

It is working for me now too. I had a package environment error. Sorry for the noise.
