API reference
Preparing search index…

ImGui.BeginTable

  • Begin a table.

    Parameters

    str_id
    string | Uint8Array

    String identifier hashed with the current ID stack to distinguish this item or scope.

    columns
    number

    Number of columns to create or freeze.

    flags
    number = 0

    ImGuiTableFlags options controlling this operation; combine compatible flag bits with |.

    Returns

    boolean

    True when the table is visible and rows may be submitted. Call EndTable() only when true; on false skip all table commands for this scope.

    Tables replace the legacy Columns API. See Demo > Tables, imgui_tables.cpp, ImGuiTableFlags, and ImGuiTableColumnFlags for examples and options.

    1. Call BeginTable() and skip the table if it returns false.
    2. Optionally declare columns with TableSetupColumn() and freeze rows or columns with TableSetupScrollFreeze().
    3. Optionally call TableHeadersRow(); it uses the declared column names.
    4. Populate cells, then call EndTable() only when BeginTable() returned true.

    Select the first cell explicitly, unlike the old Columns API. TableNextColumn() automatically wraps to the next row. These sequences are valid:

    TableNextRow() -> TableSetColumnIndex(0) -> Text("Hello 0") ->
    TableSetColumnIndex(1) -> Text("Hello 1")
    TableNextRow() -> TableNextColumn() -> Text("Hello 0") -> TableNextColumn()
    -> Text("Hello 1")
    TableNextColumn() -> Text("Hello 0") -> TableNextColumn() -> Text("Hello 1")
    

    TableNextRow() -> Text("Hello 0") is invalid: without selecting a column, the text will not appear.

    The helper uses outer_size = (0, 0) and inner_width = 0.

    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0