---
title: "Abdul Basit (@AbdulBasit) | Hashnode"
description: "MERN Stack Developer at Orange Fox Labs. Read the latest articles by Abdul Basit on Hashnode."
url: "https://hashnode.com/@AbdulBasit"
---

@AbdulBasit

# Abdul Basit

@AbdulBasit · Karachi, Pakistan · Joined May 2019

MERN Stack Developer at Orange Fox Labs

[Website](https://www.codevertiser.com/)

## Comments

[This is what I came up, the code can be improved, table will be created as soon you will input some values or state changes. Hope you will get the the idea... class App extends Component { state = { rows: '', columns: '', } onChangeValues = (e) => { this.setState({ \[e.target.name\]: e.target.value }) } onSubmitForm = (e) => { e.preventDefault() this.setState({}) } renderTable() { const rows = Array.from({ length: this.state.rows }) const columns = Array.from({ length: this.state.columns }) return rows.map((item, index) => { return ( <tr key={index}> {columns.map((item, index) => { return ( <td key={index} style={{ borderWidth: 1, borderStyle: 'solid', borderColor: '#dddddd' }}>{index}</td> ) })} </tr> ) }) } render() { const { rows, columns } = this.state return ( <div> <form onSubmit={() => this.onSubmitForm}> <div> <label htmlFor="rows">Rows</label> <input type="number" name='rows' value={rows} onChange={this.onChangeValues} /> </div> <div> <label htmlFor="columns">Columns</label> <input type="number" name='columns' value={columns} onChange={this.onChangeValues} /> </div> <button>Create Table</button> </form> <table style={{ borderCollapse: 'collapse', width: '100%' }}> <tbody> {this.renderTable()} </tbody> </table> </div> ); } } export default App;](https://hashnode.com/forums/thread/react-dynamic-table-creation/comment/5cf1ae5ad97a9ecd1fc61499)

Comment · Thread · May 31, 2019 · [react dynamic table creation](https://hashnode.com/forums/thread/react-dynamic-table-creation)

[This doesn't seem difficult, if you can show what you have done so far? I can help you with it.](https://hashnode.com/forums/thread/react-dynamic-table-creation/comment/5cf070e074e7d94015e96cb1)

Comment · Thread · May 31, 2019 · [react dynamic table creation](https://hashnode.com/forums/thread/react-dynamic-table-creation)
