# \[ANN\] PrettyTables 0.7.0

**URL:** <https://discourse.julialang.org/t/ann-prettytables-0-7-0/31369>\
**Category:** Community\
**Created:** [November 22, 2019, 12:36am UTC](https://discourse.julialang.org/t/ann-prettytables-0-7-0/31369 "2019-11-22T00:36:31Z")\
**Posts on this page:** 1\
**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 22, 2019, 12:36am UTC](https://discourse.julialang.org/t/ann-prettytables-0-7-0/31369/1 "2019-11-22T00:36:31Z")

</div>

Hi!

I just tag a new version of [PrettyTables.jl](https://github.com/ronisbr/PrettyTables.jl) (v0.7.0).

This version has two major improvements.

# HTML backend

Now, PrettyTables.jl can print tables in HTML format. This is the very first version to support this back-end and only a minimal set of features is implemented. It should be considered in beta stage and I appreciate ideas to improve it!

For more information about how to use it, please, check the [documentation](https://ronisbr.github.io/PrettyTables.jl/dev).

# Auto-wrap in text mode

Now, using the text back-end, you can fix the column size and, if you like, you can also enable auto-wrapping so that the text is fitted in the selected size. In this case, PrettyTables.jl will look for spaces to provide a better output.

Let’s say I want to print the Brazilian national anthem one verse per row:

```julia
julia> using PrettyTables

julia> table = [1 """Ouviram do Ipiranga as margens plácidas
                  De um povo heróico o brado retumbante,
                  E o sol da Liberdade, em raios fúlgidos,
                  Brilhou no céu da Pátria nesse instante.""";
             2 """Se o penhor dessa igualdade
                  Conseguimos conquistar com braço forte,
                  Em teu seio, ó Liberdade,
                  Desafia o nosso peito a própria morte!""";
             3 """Ó Pátria amada, Idolatrada, Salve! Salve!
                  Brasil, um sonho intenso, um raio vívido
                  De amor e de esperança à terra desce,
                  Se em teu formoso céu, risonho e límpido,"""]

julia> header = ["Verse number", "Verse"]

julia> pretty_table(table, header; autowrap = true, linebreaks = true, hlines = 1:4, columns_width = [-1,30])
┌──────────────┬────────────────────────────────┐
│ Verse number │ Verse │
├──────────────┼────────────────────────────────┤
│ 1 │ Ouviram do Ipiranga as │
│ │ margens plácidas │
│ │ De um povo heróico o brado │
│ │ retumbante, │
│ │ E o sol da Liberdade, em │
│ │ raios fúlgidos, │
│ │ Brilhou no céu da Pátria │
│ │ nesse instante. │
├──────────────┼────────────────────────────────┤
│ 2 │ Se o penhor dessa igualdade │
│ │ Conseguimos conquistar com │
│ │ braço forte, │
│ │ Em teu seio, ó Liberdade, │
│ │ Desafia o nosso peito a │
│ │ própria morte! │
├──────────────┼────────────────────────────────┤
│ 3 │ Ó Pátria amada, Idolatrada, │
│ │ Salve! Salve! │
│ │ Brasil, um sonho intenso, um │
│ │ raio vívido │
│ │ De amor e de esperança à │
│ │ terra desce, │
│ │ Se em teu formoso céu, │
│ │ risonho e límpido, │
└──────────────┴────────────────────────────────┘

```

Notice that the alignment keyword also works here:

```julia
julia> pretty_table(table, header; autowrap = true, linebreaks = true, hlines = 1:4, columns_width = [-1,30], alignment = :c)
┌──────────────┬────────────────────────────────┐
│ Verse number │ Verse │
├──────────────┼────────────────────────────────┤
│ 1 │ Ouviram do Ipiranga as │
│ │ margens plácidas │
│ │ De um povo heróico o brado │
│ │ retumbante, │
│ │ E o sol da Liberdade, em │
│ │ raios fúlgidos, │
│ │ Brilhou no céu da Pátria │
│ │ nesse instante. │
├──────────────┼────────────────────────────────┤
│ 2 │ Se o penhor dessa igualdade │
│ │ Conseguimos conquistar com │
│ │ braço forte, │
│ │ Em teu seio, ó Liberdade, │
│ │ Desafia o nosso peito a │
│ │ própria morte! │
├──────────────┼────────────────────────────────┤
│ 3 │ Ó Pátria amada, Idolatrada, │
│ │ Salve! Salve! │
│ │ Brasil, um sonho intenso, um │
│ │ raio vívido │
│ │ De amor e de esperança à │
│ │ terra desce, │
│ │ Se em teu formoso céu, │
│ │ risonho e límpido, │
└──────────────┴────────────────────────────────┘

```
