class Opal::UI::Table

Overview

Formatted data table component with column alignment, headers, row selection cursor, windowed scrolling pagination, and cell truncation.

Defined in:

opal/ui/components/table.cr

Constructors

Instance Method Summary

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 = "▶ ") #

[View source]

Instance Method Detail

def border_fg : Color #

[View source]
def border_fg=(border_fg : Color) #

[View source]
def cursor_char : String #

[View source]
def cursor_char=(cursor_char : String) #

[View source]
def header_fg : Color #

[View source]
def header_fg=(header_fg : Color) #

[View source]
def headers : Array(String) #

[View source]
def headers=(headers : Array(String)) #

[View source]
def move_down(count : Int32 = 1) : self #

[View source]
def move_up(count : Int32 = 1) : self #

[View source]
def page_down(count : Int32 = 10) : self #

[View source]
def page_up(count : Int32 = 10) : self #

[View source]
def preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32) #

[View source]
def render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil #

[View source]
def row(cells : Array(String)) : self #

[View source]
def rows : Array(Array(String)) #

[View source]
def rows=(rows : Array(Array(String))) #

[View source]
def scroll_offset : Int32 #

[View source]
def scroll_offset=(scroll_offset : Int32) #

[View source]
def select(idx : Int32 | Nil) : self #

[View source]
def selected_bg : Color #

[View source]
def selected_bg=(selected_bg : Color) #

[View source]
def selected_fg : Color #

[View source]
def selected_fg=(selected_fg : Color) #

[View source]
def selected_index : Int32 | Nil #

[View source]
def selected_index=(selected_index : Int32 | Nil) #

[View source]
def truncate=(truncate : Bool) #

[View source]
def truncate? : Bool #

[View source]
def visible_rows : Int32 | Nil #

[View source]
def visible_rows=(visible_rows : Int32 | Nil) #

[View source]
def zebra=(zebra : Bool) #

[View source]
def zebra? : Bool #

[View source]