I need to display dynamic data in rows and columns like attached image.
What is the best way to do that?
Best way to display dynamic tabular data?
I don't think Godot supports tables. You'll probably have to inherit from Control (of a child class of Control) and design your own Node type.
- Edited
cybereality I am currently trying with
ScrollContainer
VBoxContainer
Row 1(HBoxContainer)
Label1
Label2
Row 2(HBoxContainer)
Label1
Label2
The problem is I have to manually set the margin of row 1, row 2 to have them properly aligned and spacing and I will need to add the row data in code later.
And when the screen resolution change the margins will not be correct anymore?
Yes, you can do it that way, provided you set the min/max size all the same. But it probably won't scale correctly without manual work (for example, if you switch resolutions or drag a border). However, that would be an option if you don't want to create your own class.
- Best Answerset by newguy
What about GridContainer?
https://docs.godotengine.org/en/stable/classes/class_gridcontainer.html
Oh yeah, I forgot about GridContainer. I thought I remember there was some limitation, but it's worth looking at.
DaveTheCoder Yes it works well. Thanks!