PrettyTable::Table
Inherits Reference < Object
Constructors
Class methods
Returns a table created based on data from a .csv file.
Instance methods
Returns a new Table that is a copy of self, removing
any items that appear in other.
Adds a row to the table.
An ArgumentError is raised if the row does not
have the same size as the headers.
Returns all rows within the given range.
NOTE: See https://crystal-lang.org/api/1.0.0/Array.html#-instance-method for more information.
Adds a row to the table.
An ArgumentError is raised if the row does not
have the same size as the headers.
Removes a column from self and returns the data from the removed column.
Returns a new Table with the given columns.
Example:
table = PrettyTable::Table.new(["id", "name", "age"])
will create a table with the following columns
+----+------+-----+
| id | name | age |
+----+------+-----+
You can select just the name and age column like this
table.select(["name", "age"])
this will return a new Table with columns
+------+-----+
| name | age |
+------+-----+
However, table.select(["age", "name"]) will create a table
with columns
+-----+------+
| age | name |
+-----+------+
NOTE: If no columns are specified (empty array or an array of empty strings)
then self is returned.
Sets the table headers.
An ArgumentError is raised if headers has already been set.
Sorts a table based on the given column and returns a new Table.