class Athena::Console::Helper::Table::Cell
- Athena::Console::Helper::Table::Cell
- Reference
- Object
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.crConstructors
- .new(value : _ = "", rowspan : Int32 = 1, colspan : Int32 = 1, style : Table::CellStyle | Nil = nil)
Instance Method Summary
-
#colspan : Int32
Returns how many columns this cell should span.
-
#rowspan : Int32
Returns how many rows this cell should span.
-
#style : Table::CellStyle | Nil
Returns the style representing how this cell should be styled.
-
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
Constructor Detail
def self.new(value : _ = "", rowspan : Int32 = 1, colspan : Int32 = 1, style : Table::CellStyle | Nil = nil)
#
Instance Method Detail
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>