[ANN] PrettyTables v3.0.0

Btw, what you are using in those screenshots? I will try to install here to debug.

Could that be related to the renderer=:show option? You suggested this option in our own GeoTable type for correct HTML output. Is DataFrames.jl already using it?

I am just extracting the images from the Quarto-rendered book.

No, I don’t think so. This option changes how the cells are converted to strings only.

Hi @juliohm !

I finally could install Quarto and I know what is happening. First, Quarto stretches the table to fill the display. When we selected the default values for DataFrames.jl, we used Jupyter as the default, which does not do this.

Hence, there is two options:

  1. Keep your workaround that makes the cells use the same alignment as the column labels.
  2. Customize the Quarto output CSS to avoid this stretch.

If you want to keep the workaround, I found a very weird behavior in Quarto that we could not check for stdout if we were wrapping the io in an IOContext. I fixed this and everything should work when PrettyTables.jl v3.0.11 is released.

For the workaround, do this:

show(stdout, MIME("text/html"), df; column_label_alignment = :n)

The output will be:

3 Likes

I am not so sure this is the right place to ask, but I also struggle a bit with transitioning to 3.0; my old code (also in Quarto) was

pretty_table(df_results_time_iter; backend = Val(:markdown), header = header_1)

(see full notebook at ManoptExamples.jl/examples/CRPG-Sparse-Approximation.qmd at main · JuliaManifolds/ManoptExamples.jl · GitHub, for this line 497 for example)

I struggle with

  • what are the new ways to specify a backend and the headers?
  • The current form either prints markdown but in a code environment (meh!) or if I set #| output: asis – I hoped to get the Markdown just “as is” (the name is telling) but U just get [TABLE] then. Any idea what to do in this case?

If the second one is too advanced for this thread I can also do a new one, but the transition in Keyword arguments would be nice to know, since I could not find these in a changelog (maybe I missed that)?

Besides so many questions, thanks for providing such a nice package to do pretty tables!

1 Like

For the first one you can do:

pretty_table(df_results_time_iter; backend = :markdown, column_labels = header_1)

For the second, I have no idea. Isn’t it something related to how Quarto works?

1 Like

Thanks! For the second I opened a new thread at Strange Quarto output using PrettyTables, since I am also very unsure where to fix that (i.e. quarto vs QuartoNotebookRunner.jl vs PrettyTables.jl).

1 Like