Row Class
TheRow class represents a horizontal line of data in a table, containing multiple columns.
Creating Rows
Rows can be created with a vector of columns or strings:Accessing Rows
You can access rows in a table using the[] operator or the rows() method:
Column Class
TheColumn class represents individual cells in a table, containing text content and styling.
Creating Columns
Accessing Columns
Access columns from a row using the[] operator or columns() method:
Direct Element Access
Chain operators to access a specific column directly from a table:Column Configuration
Columns offer extensive configuration options through theconfig() method:
Alignment
Set text alignment within the column:Padding
Add padding around column content using thePadd structure:
Width
Set the width of individual columns:By default, column width is
0, which means the width is automatically calculated based on the table width. See the Width System page for details.Word Wrapping Delimiter
Set the delimiter used when wrapping long words:Empty Line Indentation
Control whether to skip whitespace at the start of new lines:Row Configuration
Rows have their own configuration options:Bottom Border
Control whether a row has a bottom border:Vertical Border
Set the vertical border character for a specific row:The row’s vertical border is overridden by the table’s border configuration. This setting is mainly for internal use.
Complete Example
Configuration Summary
| Function | Class | Parameters | Default |
|---|---|---|---|
align() | Column | Align::Left | Align::Center | Align::Right | Align::Left |
width() | Column | size_t | 0 (auto) |
padd() | Column | Padd | Padd() (no padding) |
delimiter() | Column | std::string | "-" |
skipEmptyLineIndent() | Column | bool | true |
hasBottom() | Row | bool | true |
vertical() | Row | Border::Part | '\0' |