I'm trying to create a table of buttons where the rows have the height of the tallest button and the columns have the width of the widest button : I want to create a table of buttons that when generated with x rows and y columns and user generated button captions - each button in a row is as tall as the tallest one and each button in a column is as wide as it's widest.

example - `enter code here` https://jsfiddle.net/vooka/u46j42jr/

I'm curious if there is a solution to this with flex box or if I need to use JS?

Thank you