Column spec for Harlock.Elements.table/1, built via
Harlock.Elements.column/1:
column(title: "Name", width: {:fill, 1}, render: & &1.name)
column(title: "ID", width: {:length, 4}, align: :right, render: & &1.id)Fields:
:title— header label (shown when the table hasshow_header: true):width— layout constraint:{:length, n}{:percentage, p}{:fill, w}{:min, n}{:max, n}:align—:left(default) |:right|:center:render—fn row -> String.t() | iodata(). Defaults toto_string/1of the row itself, which is what makesHarlock.Elements.list/2ergonomic (no render fn needed for simple lists).
Summary
Types
@type t() :: %Harlock.Element.Column{ align: :left | :right | :center, render: (any() -> String.t() | iodata()) | nil, title: String.t(), width: Harlock.Layout.constraint() }