ftxui::Table
#include <ftxui/dom/table.hpp>Table is a utility to draw tables.
example
auto table = Table({
{"X", "Y"},
{"-1", "1"},
{"+0", "0"},
{"+1", "1"},
});
table.SelectAll().Border(LIGHT);
table.SelectRow(1).Border(DOUBLE);
table.SelectRow(1).SeparatorInternal(LIGHT);
std::move(table).Render();Examples: dom/table
Summary
| Symbol | Description |
|---|---|
Table | Create an empty table. |
SelectAll | Select all the table. |
SelectCell | Select a cell of the table. |
SelectRow | Select a row of the table. |
SelectRows | Select a range of rows of the table. |
SelectColumn | Select a column of the table. |
SelectColumns | Select a range of columns of the table. |
SelectRectangle | Select a rectangle of the table. |
Render | Render the table. |
Public Member Functions
Table
Table();Create an empty table.
Examples: dom/table
Table
Table(const std::vector< std::vector< std::string > > &);Create a table from a vector of vector of string.
Parameters:
input: The input data.
Examples: dom/table
Table
Create a table from a vector of vector of Element.
Parameters:
input: The input elements.
Examples: dom/table
Table
Table(std::initializer_list< std::vector< std::string > > init);Create a table from a list of list of string.
Parameters:
init: The input data.
Examples: dom/table
SelectAll
TableSelection SelectAll();Select all the table.
Examples: dom/table
SelectCell
TableSelection SelectCell(int column, int row);Select a cell of the table.
Parameters:
column: The column of the cell to select.row: The row of the cell to select.
Note
You can use negative index to select from the end.
SelectRow
TableSelection SelectRow(int row_index);Select a row of the table.
Parameters:
index: The index of the row to select.
Note
You can use negative index to select from the end.
SelectRows
TableSelection SelectRows(int row_min, int row_max);Select a range of rows of the table.
Parameters:
row_min: The first row to select.row_max: The last row to select.
Note
You can use negative index to select from the end.
SelectColumn
TableSelection SelectColumn(int column_index);Select a column of the table.
Parameters:
index: The index of the column to select.
Note
You can use negative index to select from the end.
SelectColumns
TableSelection SelectColumns(int column_min, int column_max);Select a range of columns of the table.
Parameters:
column_min: The first column to select.column_max: The last column to select.
Note
You can use negative index to select from the end.
SelectRectangle
TableSelection SelectRectangle(int column_min, int column_max, int row_min, int row_max);Select a rectangle of the table.
Parameters:
column_min: The first column to select.column_max: The last column to select.row_min: The first row to select.row_max: The last row to select.
Note
You can use negative index to select from the end.
Render
Render the table.
Returns: The rendered table. This is an element you can draw.
Examples: component/button, component/button_animated, component/button_in_frame, component/canvas_animated, component/checkbox_in_frame, component/collapsible, component/composition, component/flexbox_gallery, component/focus, component/gallery, component/homescreen, component/input (+62 more)