how to create table in GUI unity?

how to create table in GUI unity? i want to get data from database sql to show into the table. please help me. thanks.

You’ll probably be best using a Grid Layout Group, but filling that group with grid elements in the manner you’re suggesting is not exactly trivial. I recommend looking around for tutorials on both using Unity UI in general, and using and populating data in Grid Layout Groups specifically. You may end up be better off in your case using a series of Horizontal Layout Groups or Vertical Layout Groups instead though. There are also assets on the UAS that do what you want, if you’re willing to spend a little money- that may be worth it, since the task isn’t trivial, just depends on what you find your time is worth.

If you’re not talking about doing it in a runtime UI, but rather in an inspector window using GUILayout tools, then this thread might be of interest instead, or check the UAS for Editor Extensions that do what you want.

Good luck!

I created this plugin to help with that, as Grid Layout Group is not really a table (all columns are the same width).
The plugin automatically fills columns with the properties of your collection.
It doesn’t handle database out of the box though, only Collection objects, but if you can fill a collection with the content of your database, it will work.

I hope it helps!

The plugin: