class
Opal::UI::Table
- Opal::UI::Table
- Opal::UI::Element
- Reference
- Object
Overview
Formatted data table component with column alignment, headers, row selection cursor, windowed scrolling pagination, and cell truncation.
Defined in:
opal/ui/components/table.crConstructors
Instance Method Summary
- #border_fg : Color
- #border_fg=(border_fg : Color)
- #cursor_char : String
- #cursor_char=(cursor_char : String)
- #header_fg : Color
- #header_fg=(header_fg : Color)
- #headers : Array(String)
- #headers=(headers : Array(String))
- #move_down(count : Int32 = 1) : self
- #move_up(count : Int32 = 1) : self
- #page_down(count : Int32 = 10) : self
- #page_up(count : Int32 = 10) : self
- #preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
- #render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
- #row(cells : Array(String)) : self
- #rows : Array(Array(String))
- #rows=(rows : Array(Array(String)))
- #scroll_offset : Int32
- #scroll_offset=(scroll_offset : Int32)
- #select(idx : Int32 | Nil) : self
- #selected_bg : Color
- #selected_bg=(selected_bg : Color)
- #selected_fg : Color
- #selected_fg=(selected_fg : Color)
- #selected_index : Int32 | Nil
- #selected_index=(selected_index : Int32 | Nil)
- #truncate=(truncate : Bool)
- #truncate? : Bool
- #visible_rows : Int32 | Nil
- #visible_rows=(visible_rows : Int32 | Nil)
- #zebra=(zebra : Bool)
- #zebra? : Bool
Instance methods inherited from class Opal::UI::Element
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
preferred_size,
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
render
Constructor Detail
def self.new(headers : Array(String) = [] of String, rows : Array(Array(String)) = [] of Array(String), header_fg : Color | Symbol | String = :cyan, border_fg : Color | Symbol | String = Color.none, selected_index : Int32 | Nil = nil, visible_rows : Int32 | Nil = nil, scroll_offset : Int32 = 0, truncate : Bool = true, zebra : Bool = false, selected_fg : Color | Symbol | String = :black, selected_bg : Color | Symbol | String = :cyan, cursor_char : String = "▶ ")
#