title: React remove column from table
body: <p>Here, I have created an application to add a number of row and column dynamically.</p>
  
  <p>I want to remove created column on remove click, I tried many things but, nothing works for me.</p>
  
  <p>When I added column remove button it also stops my row delete functionality.</p>
  
  <p>Here my working example: (In this example I have given static value but, originally it has value given using user input )</p>
  
  <p>Working code:</p>
  
  <blockquote>
    <p><a href="https://codesandbox.io/s/kk0rn33wqr" rel="nofollow noreferrer">https://codesandbox.io/s/kk0rn33wqr</a></p>
  </blockquote>
  
  <pre><code>//Remove column handler
  onRemoveEvent = id =&gt; {
     alert(id);
  
     this.setState({
        //rowCount
      });
  };
  
  
  //Here created remove button
  class Table extends Component {
    render() {
        let rowCount = this.props.rowCount;
        let numberOfColumn = this.props.numberOfColumn;
        return (
          &lt;div id="Table"&gt;
            &lt;table&gt;
              &lt;tr&gt;{
                  Array.from({length: numberOfColumn}).map((_, removeIdx) =&gt; (
                    &lt;td&gt;
                      &lt;button onClick={() =&gt; this.onRemoveEvent(removeIdx)}&gt;Remove&lt;/button&gt;
                    &lt;/td&gt;
                  ))}
              &lt;/tr&gt;
  
              {rowCount}
            &lt;/table&gt;
          &lt;/div&gt;
        );
      }
    }
  </code></pre>
  
  <p>Any help would greatly be appreciated.</p>