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

Overview

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.

Direct Known Subclasses

Defined in:

helper/table.cr

Constructors

Instance Method Summary

Constructor Detail

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

[View source]

Instance Method Detail

def colspan : Int32 #

Returns how many columns this cell should span.


[View source]
def rowspan : Int32 #

Returns how many rows this cell should span.


[View source]
def style : Table::CellStyle | Nil #

Returns the style representing how this cell should be styled.


[View source]
def to_s(io : IO) : Nil #
Description copied from class Reference

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]