struct Tablo::Summary::HeaderColumn

Overview

The Summary::HeaderColumn struct lets you define header content and specific alignment, formatting and styling

Defined in:

summary.cr

Constructors

Constructor Detail

def self.new(column : LabelType | Array(LabelType), content : String, alignment : Justify | Nil = nil, formatter : Cell::Data::Formatter | Nil = nil, styler : Cell::Data::Styler | Nil = nil) #

The constructor expects up to 5 parameters, the first 2 being mandatory

  • column : The column identifier

  • content : A string of characters (but can be empty)

  • The last three are optional (alignment, formatter and styler)

Examples:

Tablo::Summary::HeaderColumn.new("Price",
  content: "Total Invoice",
  alignment: Tablo::Justify::Right)
Tablo::Summary::HeaderColumn.new(:total,
  content: "Amounts",
  styler: ->(s : String) { s.colorize(:red).to_s })

[View source]