title: Calculating Total sum from a table
body: <p>I have the following table</p>
  <pre><code>&lt;table&gt;
                &lt;thead&gt;
                  &lt;tr&gt;
                    &lt;th&gt;&amp;nbsp;&lt;/th&gt;
                    &lt;th&gt;Available&lt;/th&gt;
                    &lt;th&gt;Incoming&lt;/th&gt;
                    &lt;th&gt;On Hand&lt;/th&gt;
                    &lt;th&gt;Outgoing&lt;/th&gt;
                  &lt;/tr&gt;
                &lt;/thead&gt;
                &lt;tbody&gt;
                  {Object.entries(text).map(([key, value]) =&gt; {
                    return (
                      &lt;&gt;
                        &lt;tr key={key}&gt;
                          &lt;td&gt;
                            &lt;TextField strong&gt;{`${key}`}&lt;/TextField&gt;
                          &lt;/td&gt;
                          &lt;td&gt;{`${value[&quot;Available&quot;]}`}&lt;/td&gt;
                          &lt;td&gt;{`${value[&quot;Incoming&quot;]}`}&lt;/td&gt;
                          &lt;td&gt;{`${value[&quot;On Hand&quot;]}`}&lt;/td&gt;
                          &lt;td&gt;{`${value[&quot;Outgoing&quot;]}`}&lt;/td&gt;
                        &lt;/tr&gt;
                      &lt;/&gt;
                    );
                  })}
                  &lt;tr&gt;
                    &lt;td&gt;Total&lt;/td&gt;
                  &lt;/tr&gt;
                &lt;/tbody&gt;
              &lt;/table&gt;
  </code></pre>
  <p>this is text:</p>
  <pre><code>var text = {
   itemName1: {
      Incoming: 1,
      on hand: 1,
      outgoing: 1,
      available: 1,
   
   },
    itemName2: {
      Incoming: 1,
      on hand: 1,
      outgoing: 1,
      available: 1,
   
   }, 
  </code></pre>
  <p>I am mapping over the items to render a list like this</p>
  <pre><code>          availabe | Incoming | On Hand | Outgoing
  itemName1  0        | 2        | 4       | 10 
  itemName2  0        | 4        | 1       | 9 
  itemName3  3        | 2        | 0       | 0
  </code></pre>
  <p>I want to add another total row at the last like the following</p>
  <pre><code>          availabe | Incoming | On Hand | Outgoing
  itemName1  0        | 2        | 4       | 10 
  itemName2  0        | 4        | 1       | 9 
  itemName3  3        | 2        | 0       | 0
  ---------------------------------------------------
  total      3        | 8        | 5       | 19 
  </code></pre>
  <p>How will i achieve this.Because total is outside the mapped array.
  please help. Thanks.</p>