# `IO.ANSI.Table.Spec.ColumnWidths`
[🔗](https://github.com/RaymondLoranger/io_ansi_table/blob/main/lib/io/ansi/table/spec/column_widths.ex#L1)

Derives the column widths of a table.

# `derive_and_put`

```elixir
@spec derive_and_put(IO.ANSI.Table.Spec.t()) :: IO.ANSI.Table.Spec.t()
```

Derives the column widths of a table.

## Examples

    iex> alias IO.ANSI.Table.Spec.{ColumnWidths, Headings, Rows}
    iex> alias IO.ANSI.Table.Spec
    iex> spec = Spec.new([:c4, :c1, :c2])
    iex> maps = [%{c1: 11, c2: 12, c4: 14}, %{c1: 21, c2: 22, c4: :r2c4}]
    iex> spec = Headings.derive_and_put(spec)
    iex> spec = Rows.derive_and_put(spec, maps)
    iex> spec = ColumnWidths.derive_and_put(spec)
    iex> %Spec{column_widths: column_widths} = spec
    iex> column_widths
    [4, 2, 2]

---

*Consult [api-reference.md](api-reference.md) for complete listing*
