How to put buttons in a list?

Hello, I’m trying to do an inventory system and I’m having problems. I have all the objects in an array so far. How would I go about putting the buttons in a list? that way I can have the buttons only show when the item is present without having huge gaps. I’m using JavaScript

Take a look at the GUILayout class.

Although I’d strongly recommend at looking at getting NGUI or a 3rd party tool for GUI stuff. NGUI also has a free version.