How to equally space out dynamic number of components

I have a container with a hbox layout that can have x number of components inside it. I want the components to be equally spaced apart along the whole horizontal length. I can't use flex because the components themselves need to have fixed width. How can this be done? Thanks in advance.