title: create table from JSON object in react
body: <p>I am creating a table dynamically in React with the API response as it is as it receives.</p>
  <pre><code>data = {&quot;name&quot;:&quot;tom&quot;, &quot;age&quot;:23, &quot;group&quot;:null, &quot;phone&quot;:xxx}
  </code></pre>
  <p>It is working fine with that, but the group key sometimes contains another object, so I want to create a sub-table whenever there is another object inside a key.</p>
  <p>For example:</p>
  <pre><code>data = {&quot;name&quot;:&quot;tom&quot;, &quot;age&quot;:23, &quot;group&quot;:{&quot;id&quot;:123, &quot;joined_at&quot;:12-jan-2022}, &quot;phone&quot;:xxx}
  </code></pre>
  <p>My current code is:</p>
  <pre><code>&lt;table&gt;
    {Object.keys(data).map(index=&gt; (
      &lt;tr&gt;
        &lt;td&gt;{index}&lt;/td&gt;
        &lt;td&gt;{data[index]?.toString()}&lt;/td&gt;
      &lt;/tr&gt;
     ))}
  &lt;/table&gt;
  </code></pre>