How to make butons in footer to take all footer width

How to make butons in footer to take all footer width

Hi,
 
I have footers with variable number of buttons, if there's only one button it should take all available footer space, if there are two - each will take half the footer width, and so on.. I'd like to have some space between buttons. What would be the best way to achive this?
 
Thanks!