我正在试验React和react-data-table-component。我设置了一个测试表,如下所示:
<DataTable
title={'TestTitle'}
columns={[{ name: 'test 1', selector: 'test1' }, { name: 'test 2', selector: 'test2' }, { name: 'test 3', selector: 'test3' }, { name: 'test 4', selector: 'test4' }, { name: 'test 5', selector: 'test5' }]}
striped
responsive
pagination paginationRowsPerPageOptions={[5, 10, 25, 50, 100]} />我注意到在表中标题div的右侧生成了一个div。它只有一些奇怪的类分配给it.Is,是否可以在这个div中输入数据,并向DataTable添加一些属性?

我已经尝试过subHeader属性,但它将新文本放在标题下,使得表格稍微变高,这是不可取的。
<DataTable
title={'TestTitle'}
subHeader subHeaderComponent={'TestSubHeader'}
columns={[{ name: 'test 1', selector: 'test1' }, { name: 'test 2', selector: 'test2' }, { name: 'test 3', selector: 'test3' }, { name: 'test 4', selector: 'test4' }, { name: 'test 5', selector: 'test5' }]}
striped
responsive
pagination paginationRowsPerPageOptions={[5, 10, 25, 50, 100]} />

发布于 2020-05-11 16:50:27
好吧,很明显,为了自己的利益,我有点急不可耐。大约在我发布这个问题的一分钟后,我意识到actions属性做的正是我想要的。我想我现在可能应该删除这个问题了。或者这些信息对其他人有用吗?
https://stackoverflow.com/questions/61725569
复制相似问题