Skip to content

struct Athena::Console::Helper::Table::CellStyle
inherits Struct #

Represents the styling for a specific ACON::Helper::Table::Cell.

Constructors#

.new(foreground : String = "default", background : String = "default", align : ACON::Helper::Table::Alignment = :left, format : String | Nil = nil)#

Methods#

#align : ACON::Helper::Table::Alignment#

How the text should be aligned in the cell.

See ACON::Helper::Table::Alignment.

#background : String#

Returns the background color for this cell.

Can be any color string supported via ACON::Formatter::OutputStyleInterface, e.g. named ("red") or hexadecimal ("#38bdc2") colors.

#foreground : String#

Returns the foreground color for this cell.

Can be any color string supported via ACON::Formatter::OutputStyleInterface, e.g. named ("red") or hexadecimal ("#38bdc2") colors.

#format : String | ::Nil#

A sprintf format string representing the content of the cell. Should have a single %s representing the cell's value.

Can be used to reuse custom style tags. E.g. "<fire>%s</>".