We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37075d3 commit 0ab6fa5Copy full SHA for 0ab6fa5
src/TableView.jl
@@ -18,13 +18,21 @@ end
18
to_css_size(s::AbstractString) = s
19
to_css_size(s::Real) = "$(s)px"
20
21
-function showtable(table; dark = false, height = 500, width = "100%")
+function showtable(table; dark = false, height = :auto, width = "100%")
22
if !Tables.istable(typeof(table))
23
throw(ArgumentError("Argument is not a table."))
24
end
25
26
tablelength = Base.IteratorSize(table) == Base.HasLength() ? length(Tables.rows(table)) : nothing
27
28
+ if height === :auto
29
+ height = 500
30
+ if tablelength !== nothing
31
+ # header + footer height ≈ 40px, 28px per row
32
+ height = min(40 + tablelength*28, height)
33
+ end
34
35
+
36
rows = Tables.rows(table)
37
schema = Tables.schema(table)
38
if schema === nothing
0 commit comments