4#include <initializer_list>
25 Table( std::string
id, std::vector<std::string> headers );
35 void addRow( std::vector<std::string> cells );
40 void addRow( std::initializer_list<std::string_view> cells );
60 void draw(
const ImVec2 & outerSize )
const;
68 std::vector<std::vector<std::string>>
rows_;
void addRow(std::initializer_list< std::string_view > cells)
Adds a row from string-view cell literals matching the header count.
std::vector< float > columnWidthFractions() const
Returns normalized column width fractions after applying minimum widths.
static constexpr float MinimumColumnWidthFraction
Minimum normalized width assigned to any column.
void clearRows()
Removes all table rows while keeping headers and column widths.
std::vector< std::optional< float > > columnWidths_
void setColumnWidth(std::size_t columnIndex, float widthFraction)
Sets the preferred normalized width for a column.
void drawClippedCellText(const std::string &text) const
void draw(const ImVec2 &outerSize) const
Draws the table into the current ImGui context.
Table(std::string id, std::vector< std::string > headers)
Creates a table with a stable ImGui ID and header labels.
void addRow(std::vector< std::string > cells)
Adds a row of cells matching the header count.
std::size_t columnCount() const
Returns the number of table columns.
std::vector< std::vector< std::string > > rows_
std::vector< std::string > headers_