【问题标题】:Adding id's for Bootstraptable react为 Bootstraptable 反应添加 id
【发布时间】:2017-09-22 04:00:01
【问题描述】:
我正在尝试为 react-bootstrap-table 模块的 Bootstraptable 标签添加一个 id。我看到了道具。有一个 tablebodyclass 道具,我们可以在其中设置类名。但我希望这张桌子是独一无二的。我应该如何为表引入 Id?
【问题讨论】:
标签:
reactjs
bootstrap-table
react-bootstrap-table
【解决方案1】:
添加到表格顶部
<table id="test">
<tr>
<td></td>
</tr>
</table>
【解决方案2】:
如果有人用 "react-bootstrap-table-next": "^4.0.3"
偶然发现这个问题
<BootstrapTable id="someID" ... />
这很有魅力
检查结果:
<table id="someID" class="table table-bordered table-condensed"><thead> ... </thead><table>