Skip to content

class Athena::Console::Helper::Table::Cell
inherits Reference #

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 and ACON::Helper::Table::CellStyle for more information.

Direct known subclasses

Athena::Console::Helper::Table::Separator

Constructors#

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

View source

Methods#

#colspan : Int32#

Returns how many columns this cell should span.

View source

#rowspan : Int32#

Returns how many rows this cell should span.

View source

#style : Table::CellStyle | ::Nil#

Returns the style representing how this cell should be styled.

View 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>
View source