Tables: Try to report contents width to outer window, generally better auto-fit.

This commit is contained in:
omar
2020-05-13 23:42:22 +02:00
committed by ocornut
parent 466b6e619a
commit dff26191bd
3 changed files with 63 additions and 30 deletions

View File

@ -3570,6 +3570,24 @@ static void ShowDemoWindowTables()
}
ImGui::EndTable();
}
if (ImGui::BeginTable("##table2", 3, flags | ImGuiTableFlags_SizingPolicyFixedX))
{
ImGui::TableSetupColumn("One");
ImGui::TableSetupColumn("Two");
ImGui::TableSetupColumn("Three");
ImGui::TableAutoHeaders();
for (int row = 0; row < 6; row++)
{
ImGui::TableNextRow();
for (int column = 0; column < 3; column++)
{
ImGui::TableSetColumnIndex(column);
ImGui::Text("Fixed %d,%d", row, column);
}
}
ImGui::EndTable();
}
ImGui::TreePop();
}