【发布时间】:2021-11-22 10:00:05
【问题描述】:
我有一张桌子和一张表格。当在表单中输入详细信息后单击“添加”按钮时,我希望将数据作为表中的新表行输入,但是,我尝试过的方法都没有奏效。我正在使用 reactjs,reactstrap。 这是我的代码:
<Row form>
<Col md={6}>
<FormGroup>
<Label for="proName">Product Name</Label>
<Input type="proName" name="proName" id="proName" placeholder="Product Name" />
</FormGroup>
</Col>
<Col md={6}>
<FormGroup>
<Label for="storeName">Store Name</Label>
<Input type="storeName" name="storeName" id="storeName" placeholder="Store Name" />
</FormGroup>
</Col>
<Col md={6}>
<FormGroup>
<Label for="pPrice">Price</Label>
<Input type="pPrice" name="pPrice" id="pPrice" placeholder="Price" />
</FormGroup>
</Col>
</Row>
.......
<CardBody>
<Table className="tablesorter" responsive>
<thead className="text-primary">
<tr>
<th>Store</th>
<th>Product</th>
<th>Price</th>
</tr>
</thead>
<tbody id="tbid">
<tr>
<td>
{/*Here is where the new rows should be input*/}
</td>
</tr>
</tbody>
</Table>
</CardBody>
【问题讨论】:
标签: javascript reactjs reactstrap