【问题标题】: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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-06-20
    • 1970-01-01
    • 1970-01-01
    • 2021-03-11
    • 2020-02-27
    • 2022-12-19
    • 2019-03-12
    • 2021-08-09
    相关资源
    最近更新 更多