alias Tablo::DataCellFormatter

Overview

Formatter Proc for data cell types (Header and Body).

Any processing can be done on cell value.

The first form allows for conditional formatting, depending on attribute values of Tablo::CellData (row_index or column_index).

For example, to alternate case after each row, the Proc would be:

formatter: ->(c : Tablo::CellType, d : Tablo::CellData) {
  d.row_index % 2 == 0 ? c.as(String).upcase : c.as(String).downcase }

The second form is the same as Tablo::TextCellFormatter

Alias Definition

Tablo::CellType, Int32 -> String | Tablo::CellType -> String | Tablo::CellType, Tablo::CellData, Int32 -> String | Tablo::CellType, Tablo::CellData -> String

Defined in:

types.cr