emilk / emilk/egui

There may be some problems with the layout of the table

Open
#3,680 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

**Describe the bug**
```rust
let table = TableBuilder::new(ui)
.resizable(true)
.cell_layout(Layout::centered_and_justified(Direction::TopDown))
.column(Column::auto())
.column(Column::exact(20.0))
.column(Column::initial(200.0).range(40.0..=300.0))
.column(Column::initial(200.0).range(40.0..=300.0))
.column(Column::remainder())
.min_scrolled_height(0.0);
table.header(20.0, |mut header| {
header.col(|ui| {
ui.strong("");
});
header.col(|ui| {
ui.strong("");
});
header.col(|ui| {
ui.strong("KEY");
});
header.col(|ui| {
ui.strong("VALUE");
});
header.col(|ui| {
ui.strong("DESCRIPTION");
});
}).body(|mut body|{
for param in data.rest.request.params.iter_mut() {
body.row(18.0, |mut row| {
row.col(|ui| {
ui.checkbox(&mut param.enable,"");
});
row.col(|ui| {
if ui.button("x").clicked(){

}
});
row.col(|ui| {
ui.text_edit_singleline(&mut param.key);
});
row.col(|ui| {
ui.text_edit_singleline(&mut param.value);
});
row.col(|ui| {
ui.text_edit_singleline(&mut param.desc);
});
});
}
body.row(18.0, |mut row| {
row.col(|ui| {
ui.checkbox(&mut self.new_param.enable,"");
});
row.col(|ui| {
if ui.button("x").clicked(){

}
});
row.col(|ui| {
ui.text_edit_singleline(&mut self.new_param.key);
});
row.col(|ui| {
ui.text_edit_singleline(&mut self.new_param.value);
});
row.col(|ui| {
ui.text_edit_singleline(&mut self.new_param.desc);
});

});
});
```
Table using centered_and_justified layout will cause width and window size mismatch.

**Screenshots**
image

**Desktop (please complete the following information):**
- OS:

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the provided TableBuilder example with egui 0.24.1, using the listed column definitions and centered_and_justified layout. Inspect the table layout behavior and compare its computed width with the window shown in the screenshot. Done means the table and window widths remain consistent for this configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.