class

Athena::Console::Helper::Table::Cell

Inherits Reference / Object

Represents a cell that can span more than one column/row and/or have a unique style. The cell may also have a value, which represents the value to display in the cell.

For example:

table
  .rows([
    [
      "Foo",
      ACON::Helper::Table::Cell.new(
        "Bar",
        style: ACON::Helper::Table::CellStyle.new(
          align: :center,
          foreground: "red",
          background: "green"
        )
      ),
    ],
  ])

See the [table docs][Athena::Console::Helper::Table--table-cells] and ACON::Helper::Table::CellStyle for more information.

Constructors

new(value : _ = "", rowspan : Int32 = 1, colspan : Int32 = 1, style : Table::CellStyle | Nil = nil)
Source

Instance methods

colspan

Returns how many columns this cell should span.

Source
rowspan

Returns how many rows this cell should span.

Source
style

Returns the style representing how this cell should be styled.

Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source