BrowseTables configure details of table

I have a table in a Pluto notebook that I would prefer to have as an HTML object, so that I can smoothly integrate it with test in markdown. BrowseTables.jl does exacly that - defining an HTMLTable and using the $variable string interpolation inside a markdown string works great, as demonstrated below.

I am however struggeling with the API of BrowseTables for custumization, and I find the documentation lacking.

First of all, I dont understand why my caption looks like a title, and I have no idea where my actual title has gone.

Secondly, I think that for a table like this, the heavy blue line at the top AND bottom is too much. I can however not see how I would change this from the minimalistic documentation. I would love the ability to make the blue more light, and to remove the bottom line.

Another thing that I think might be better as an issue with the package but included here in order not to split things up unessecarily, is the fact that it seems like BrowseTables changes some defults in the tables already defined in my pluto notebook through markdown. Below are two pictures without using BrowseTables:


And here are two WITH using BrowseTables:


In general, I prefer the defaults that are used by Pluto to the ones from BrowseTables that seem to overwrite the Pluto-defaults. Maybe Pluto could be an optional style? Or wherever those defaults are actually defined anyways.

If we could get some detailed explanation of how the arguments work, I would be happy to write up some documentation for BrowseTables.jl, as I think the package solves a problem that I happened to stumble upon and so deserves work put into it :slight_smile:

1 Like

Package author here — I am happy to hear that you find it useful.

Issues and PRs are welcome, I added an empty docs template and did some housekeeping (CI with actions).

1 Like

Problem is, I don’t know what to put in the docs because I current have questions as opposed to answers…

Are you saying that I should create issues over at the package-repo and take things from there?

@Tamas_Papp, your BrowseTables viewer is excellent, very useful for large tables.

Tried it with code below and would like to ask you how to format the numbers highlighted? Thanks in advance.

using  BrowseTables, XLSX, DataFrames

url = "https://download.microsoft.com/download/1/4/E/14EDED28-6C58-4055-A65C-23B4DA81C4DE/Financial%20Sample.xlsx"

download(url, "Sample_data2.xlsx")

df = DataFrame(XLSX.readtable("Sample_data2.xlsx", "Sheet1", infer_eltypes=true)...)

open_html_table(df) # open in browser

Yes, please unbundle the suggestions above and open issues and PRs. That said, the API has docstrings so the package has some documentation, it is just not in the generated docs.

1 Like

I would round them before calling open_html_table.

@Tamas_Papp, it is interesting that in the original Excel file in example above, even when we ask Excel to display values with 20 digits, say for row (55/54) and Sales column (10), it still shows only zeros after .85:
$27,338.85000000000000000000
However, the XLSX.jl read + DataFrames.jl “direct” workflow above extracts:
27338.850000000002

Such problem repeats for a quite large number of Excel entries.
So these numerical annoyances seem to occur before BrowseTables.

@Tamas_Papp, the simple round-off loop below fixes the problem for the example at hands:

using  BrowseTables, XLSX, DataFrames

url = "https://download.microsoft.com/download/1/4/E/14EDED28-6C58-4055-A65C-23B4DA81C4DE/Financial%20Sample.xlsx"

download(url, "Sample_data2.xlsx")

df = DataFrame(XLSX.readtable("Sample_data2.xlsx", "Sheet1", infer_eltypes=true)...)

for n in names(df)
    if eltype(df[!,n]) <: Number
        df[!,n] = round.(df[!,n], digits=2)
    end
end 

open_html_table(df) # open in browser

It would probably be more convenient for the users if such rounding-off functionalities were built-in in BrowseTables.

I disagree, preprocessing your data is orthogonal to displaying it and the two need not be coupled.

OK, let’s agree to disagree. :wink: