struct TUI::TableColumn

Overview

One column definition, driving TableView's layout (see TableView#compute_col_widths). Columns start at #preferred_width; if the available width is too small they shrink toward #min_width (proportionally to slack above the floor); if there's width to spare, only columns with #expand true grow to fill it, split proportionally to their own #preferred_width. #align controls Term.fit's padding side for both header and cell text.

Defined in:

tui/data_sources/table_data_source.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(header : String, min_width : Int32, preferred_width : Int32, expand : Bool = false, align : Align = Align::Left) #

[View source]

Instance Method Detail

def align : Align #

def clone #

[View source]
def copy_with(header _header = @header, min_width _min_width = @min_width, preferred_width _preferred_width = @preferred_width, expand _expand = @expand, align _align = @align) #

[View source]
def expand : Bool #

def header : String #

def min_width : Int32 #

def preferred_width : Int32 #