Opal::UI::Table
Inherits Opal::UI::Control < Opal::UI::InputHookable < Opal::UI::Element < Opal::UI::Themable < Reference < Object
Formatted data table component with column alignment, headers, row selection cursor, windowed scrolling pagination, and cell truncation.
Constructors
new(headers : Array(String) = [] of String, rows : Array(Array(String)) = [] of Array(String), header_fg : Color | Symbol | String | Nil = nil, header_bg : Color | Symbol | String | Nil = nil, border_fg : Color | Symbol | String | Nil = nil, 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 | Nil = nil, selected_bg : Color | Symbol | String | Nil = nil, zebra_bg : Color | Symbol | String | Nil = nil, cursor_char : String | Nil = nil, divider_char : String | Nil = nil, border_style : Border | Symbol | String | Nil = nil, print_mode : Bool = false)
SourceClass methods
print(headers : Array(String), rows : Array(Array(String)), io : IO = STDOUT, width : Int32 | Nil = nil, zebra : Bool = false, border_style : Border | Symbol | String | Nil = nil, theme : Theme | Nil = nil, color : Bool | Nil = nil) : Nil
Class convenience method printing styled table directly to IO
Instance methods
border_fg
Sourceborder_fg=(border_fg : Color | Nil)
Sourceborder_style
Sourceborder_style=(border_style : Border | Nil)
Sourcecursor_char
Sourcedivider_char
SourceDefault key event handler. Override in subclasses if not using @default_input_proc.
Default mouse event handler. Override in subclasses if not using @default_input_proc.
header_bg
Sourceheader_bg=(header_bg : Color | Nil)
Sourceheader_fg
Sourceheader_fg=(header_fg : Color | Nil)
Sourceheaders
Sourcehorizontal_char
Sourcejunction_char
Sourcemarkdown_mode?
SourcePreferred size in print mode: full row height and natural column width
print_mode?
SourceRender hook for one-shot print mode: renders all rows without cursor or scroll clipping
rows
Sourcescroll_offset
Sourceselected_bg
Sourceselected_bg=(selected_bg : Color | Nil)
Sourceselected_fg
Sourceselected_fg=(selected_fg : Color | Nil)
Sourceselected_index
Sourcetruncate?
Sourcevertical_char
Sourcevisible_rows
Sourcezebra?
Sourcezebra_bg
Sourcezebra_bg=(zebra_bg : Color | Nil)
Source