score:0

Accepted answer

given your description of the dataset this might be a possible solution:

<table>
  <tablehead>
    <tablerow>
      {a.map((column, index) => (
        <tablecell key={index}>{column.name}</tablecell>
      ))}
    </tablerow>
  </tablehead>
  <tablebody>
    {a[0].values.map((_, rowindex) => (
      <tablerow key={rowindex}>
        {a.map((row, colindex) => (
          <tablecell key={colindex}>
            {row.values[rowindex]}
          </tablecell>
        ))}
      </tablerow>
    ))}
  </tablebody>
</table>

edit elastic-butterfly-2cyp7

note that this requires every entry in your data set to have the exact same amount of values and there must be at least one entry in the list.

basically it takes the number of expected values for each row from the length of the list of values of the first item in your data set. this seem very fishy to me and is very likely a flaw in your concept. tables are row based and the number of rows should be the number of entries in your list.


Related Query

More Query from same tag