struct Athena::Console::Helper::Table::CellStyle

Overview

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

Defined in:

helper/table_cell_style.cr

Constructors

Instance Method Summary

Constructor Detail

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

[View source]

Instance Method Detail

How the text should be aligned in the cell.

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


[View source]
def background : String #

Returns the background color for this cell.

Can be any color string supported via [ACON::Formatter::OutputStyleInterface][Athena::Console::Formatter::OutputStyleInterface--inline-styles], e.g. named ("red") or hexadecimal ("#38bdc2") colors.


[View source]
def foreground : String #

Returns the foreground color for this cell.

Can be any color string supported via [ACON::Formatter::OutputStyleInterface][Athena::Console::Formatter::OutputStyleInterface--inline-styles], e.g. named ("red") or hexadecimal ("#38bdc2") colors.


[View source]
def 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][Athena::Console::Formatter::OutputStyleInterface--custom-styles]. E.g. "<fire>%s</>".


[View source]