alias Tablo::Border::Styler

Overview

A border may be styled, either by using ANSI color sequences or using the stdlib colorize module.

Styler default value is set by Tablo::Config::Defaults.border_styler

Example, to colorize borders in red :

require "tablo"
require "colorize"
table = Tablo::Table.new([1, 2, 3],
  border: Tablo::Border.new(Tablo::Border::PreSet::Ascii,
    styler: ->(border_chars : String) { border_chars.colorize(:red).to_s })) do |t|
  t.add_column("itself", &.itself)
end
puts table

Alias Definition

String -> String

Defined in:

border.cr