title: How to display data to table in React Js?
body: <p>I'm trying to display some data received through API to table in React Js, data is received as object so I can't map trough it. What would be the best practice in this situation? For now the data is hardcoded, but it needs to be dynamic.</p>
  <p>My code in <a href="https://codesandbox.io/s/ancient-water-w4mmm?file=/src/App.js:24-1182" rel="nofollow noreferrer">CodeSandbox</a></p>
  <pre><code>export default function App() {
  
    const data ={
      
      &quot;people&quot; :[
        {
          &quot;name&quot;:&quot;John&quot;,
          &quot;last_name&quot;:&quot;Doe&quot;,
          &quot;age&quot;:&quot;25&quot;,
          &quot;Occupation&quot;:&quot;driver&quot;,
        },
        {
          &quot;name&quot;:&quot;Jack&quot;,
          &quot;last_name&quot;:&quot;Brown&quot;,
          &quot;age&quot;:&quot;24&quot;,
          &quot;Occupation&quot;:&quot;it&quot;
        },
        {
          &quot;name&quot;:&quot;Oliver&quot;,
          &quot;last_name&quot;:&quot;Black&quot;,
  
          &quot;age&quot;:&quot;30&quot;,
          &quot;Occupation&quot;:&quot;cto&quot;
        },
      ],
  
      &quot;format&quot;:{&quot;last_name&quot;:&quot;Last Name&quot;}
    }
    
    return (
      &lt;div className=&quot;App&quot;&gt;
       &lt;table&gt;
         &lt;tbody&gt;
           &lt;tr&gt;
             &lt;td&gt;Name&lt;/td&gt;
             &lt;td&gt;John&lt;/td&gt;
             &lt;td&gt;Jack&lt;/td&gt;
             &lt;td&gt;Oliver&lt;/td&gt;
             
           &lt;/tr&gt;
           &lt;tr&gt;
             &lt;td&gt;Last Name&lt;/td&gt;
             &lt;td&gt;Doe&lt;/td&gt;
             &lt;td&gt;Brown&lt;/td&gt;
             &lt;td&gt;Black&lt;/td&gt;
             
           &lt;/tr&gt;
           &lt;tr&gt;
             &lt;td&gt;Age&lt;/td&gt;
             &lt;td&gt;25&lt;/td&gt;
             &lt;td&gt;24&lt;/td&gt;
             &lt;td&gt;30&lt;/td&gt;
             
           &lt;/tr&gt;
           &lt;tr&gt;
             &lt;td&gt;Occupation&lt;/td&gt;
             &lt;td&gt;driver&lt;/td&gt;
             &lt;td&gt;it&lt;/td&gt;
             &lt;td&gt;ceo&lt;/td&gt;
           &lt;/tr&gt;
  
           
         &lt;/tbody&gt;
       &lt;/table&gt;
      &lt;/div&gt;
    );
  }
  
  
  </code></pre>
  <p>needs to be displayed as</p>
  <pre><code>Name         John     Jack      Oliver
  Last Name    Doe      Brown     Black
  Age          25       24        30
  Occupation   driver   it        ceo
  </code></pre>
  <p>I can't figure out how to display the data dynamically ( and also add data from <strong>format</strong> part. I would appreciate any suggestion and help, thank you.</p>