nextjournal 2022-02-07

In the case of table with lots of columns, the "full" option does not use max width:

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

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))

πŸ‘ 2

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]}
   ....

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?