Tablo::Table
Inherits Enumerable < Reference < Object
Constants
Constructors
Creates a new Table instance, with block
sources is the only mandatory parameter, all other have default values
Creates a new Table instance, without block
Instance methods
Add a column to the table
This method must be used with a block defining the extracting logic
Calls the given block once for each {Row} in the Table, passing that {Row} as parameter.
When printed, the first row will visually include the headers (assuming these were not disabled when the Table was initialized). Iterates on source elements, creating formatted rows dynamically
Returns a formatted body row, including headers where appropriate
Returns an "ASCII" graphical representation of the Table column (possibly multilines) headers.
Reset all the column widths so that each column is just wide enough to accommodate its header text as well as the formatted content of each of its cells for the entire collection, together with a single character of padding on either side of the column, without any wrapping.
Note that calling this method will cause the entire source to be traversed and all the column extractors and formatters to be applied in order to calculate the required widths.
Returns graphical "ASCII" representation of the Table, suitable for display in a fixed-width font.