In the case of table with lots of columns, the "full" option does not use max width:
I know, hope I was going to fix it before anybody noticed π https://github.com/nextjournal/clerk/blob/ec07ed2701fb82ecac94c786a1310d7e324cab18/src/nextjournal/clerk/viewer.cljc#L222
If I render a table from seq-of-maps, can I control column order ?
I tried this approach with a dataset that has a bunch of columns. It rendered like this:
Is there a way to force showing the full column name, and then just make it possible to scroll off to the right?
by being sorted? making your coll an instance of clojure.lang.Sorted
but donβt think this is ideal as-is
My frequent use case is to render a tmd dataset. It has a ->maps function, which looses column sorting ..
but itβs ordered when iterating over it?
also open to providing other means for controlling column order
to also support things like https://github.com/clj-commons/ordered
I solved it by using use-headers
(defn ->table [df]
(->
(concat [(tc/column-names df)]
(tc/rows df :as-seqs))
clerk/use-headers
clerk/table))So I think clerk itself does not need more. use-headers is there.
I was just thinking that maybe use-headers could become an option of table instead of own function.
(clerk/table
{:headers [a b c]}
....can also directly return a map with rows and head https://github.com/nextjournal/clerk/blob/main/src/nextjournal/clerk/viewer.cljc#L133
Hey @carsten.behring I think I ran into this same problem when trying to view a tmd dataset using clerk/table.
So this is helpful!
I guess this also means that clerk/table is the what we need to use to view a tmd dataset in clerk?
yes.