Dataframe (or generally pretty table) without header in Pluto

I am creating a certificate in Pluto, and I am currently displaying tables by putting them in a dataframe, which produces:

But the headers, which are not necessary, take up a lot of space. While a problem on its own, a further problem is spacing issues. Is there a way to not show the headers when displaying a DataFrame in pluto?

Alternatively, are there other ways of nicely display a table that takes less space? The purpose is to include the original data for reproducibility, and things have to look as professional as possible.

Another issue is potentially the row numbers - is it possible that 10 columns could be fitted if that column were not there? There are 50 datapoints, so if I want to fill the table I can at most have 5 columns, because the next higher factor in 50 is 10, which results in the need for horizontal scrolling. I have tried the following

based on

from this discussion. I guess I will have to supply the kwarg to show somehow, but i have had little luck in the past when experimenting with calling show directly.

You won’t be able to get around this without passing show directly. And you if you do that you might as well just call pretty_table directly and get even more options.

Pluto is leaving room for the header, but not showing the column types that are supposed to be in the header… that’s odd. Are they written, but in a white font so that it’s not showing up?

There is a very nice mouse-over animation that shows the types, so that they dont always show. Huge fan.

Mousing over:

Huh, i’m not sure I’m a fan of that. For one, all your types as Any which can be a major problem! And you wouldn’t know unless you mouse-over.

Pretty tables seemed to print to the terminal, as opposed to showing up in the notebook (see this issue). Aaaaaand I see in the issue I linked to that I could display the pretty_table with HTML(), and there are even some nice kwarg examples in the issue. I will look into this. But the original issue remains, that I would still prefer to have no header.

I mean, changing the type is completely irrelevant for my application. I even have strings in the dataframe at a previous point, which is the reason for the type being Any - I am parsing them from an excel document that I am not writing, so I want to be able to handle any funky formatting thown at me from Excel. I simply need them to print pretty for a final displayed PDF.

I would say you are stuck with HTML(pretty_table(...)). It probably isn’t worth it to override show globally, especially since Pluto seems to have attached some kind of complicated behavior.

You could write your own html table with

Usage in Pluto is shown here:

1 Like