How can i make UITableLayout make a new row after x amount

i am making a train consist builder and I have a gui for it and I want to make it self add a button per each model in server storage which I have working but the problem is with UITableLayout I want it to make a new column itself

the UITableLayout doesn’t make a new column once it goes past 4 the amount that fits and it just goes off the frame and I want to know if I can script something to do this automatically or if another ui instance thing does.

these are the results image
as you can see there are 4 here and not 8 because they are below and id like to not have vertical and horizontal scrollbars.

I made some code that would check a number value and if it goes over 4 it would make a new frame and change the parent and so on so forth, it printed to output so it was working but it wouldn’t clone. I looked around online a lot but couldn’t find anything.

I lost the code I had before to attempt to make new frames so advice or a solution entirely would be appreciated.

1 Like

Hello! :smiley:

The number of UI objects are determined by the size of the UITableLayout’s parent.

If you want the frames to fill horizontally (x),the FillDirection must be horizontal. To find the amount of frames or UI elements that can fit in the UITableLayout’s parent, you have to divide the frame’s size offset by the size of the frame you want to fill the UITableLayour with’s offset x size.

Same with the vertical, or y, but just change all of the x’s to y’s.

1 Like

not even what im asking but okay