Table with dynamic rows and columns

I would like to display a table panel whose rows and columns are created dynamically based on a data binding.
There are a lot of examples for tables where the rows are dynamic.
What can I do if the columns should also be dynamic?

For example, the following data structure

columnDefinition: [{name: "First Column" }, {name: "Second column"}];

rows: [{
  cells: [{name: "First column", value: "abc"}, {name: "Second column", value: "def"}
  cells: [{name: "First column", value: "123"}, {name: "Second column", value: "345"}
}];

Should created the following table:

First Column | Second Column
abc          | def
123          | 345

Note that I don’t know the column names and column count at compile time, as they depend on the user input.

It’s a bit more complicated because there needs to be nested itemArray bindings and a fixed header with isPanelMain set to true with its own itemArray binding:

Oh, this example uses data bindings, didn’t know that!
Thanks, I think I can work with this as a starting point!