title: How to access table cell data in react
body: <p>I have created a cart using reactjs and now I pass an object into the cart and I can add quantity and then I will be calculated automatically subtotal of a product. But now I have to calculate Total using this subtotal value. So Can I know how to access table column 'subtotal' and calculate the total price of products purchased? </p>
  
  <p>I have attached the table below.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>render(){
   const subtot =this.DrugsDetailsRequest.totalPrice*this.state.textInputValue1
          console.log(subtot);// this will get you the total
          const sum=sum+subtot;
          console.log(sum);
          return (
  
                  &lt;tr&gt;
                      &lt;td data-th="Product"&gt;
                          &lt;p&gt;{this.DrugsDetailsRequest.item_name}&lt;/p&gt;
                      &lt;/td&gt;
                      &lt;td&gt; Rs: {this.DrugsDetailsRequest.totalPrice}&lt;/td&gt;
                      &lt;td&gt;
                          &lt;input name="textInputValue1" type="number" className="form-control text-center"  onChange={ this.handleChange } /&gt;
                      &lt;/td&gt;
                      &lt;td className="text-center"&gt;
                          &lt;input name="textInputValue2" type="text" className="form-control text-center" value={subtot}
                                  onChange={ this.handleChange } /&gt;
                      &lt;/td&gt;
                      &lt;td className="actions"&gt;
                          &lt;button className="btn btn-danger btn-sm" onClick={(e) =&gt; this.delete(this.DrugsDetailsRequest._id)}&gt;Delete&lt;/button&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
          );
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/sfhyJ.png" rel="nofollow noreferrer">enter image description here</a></p>