首页 > 解决方案 > 在 react-table 中设置 selectTable 标头的样式

问题描述

使用 react-table 组件中的 selectTable 选项,我们已经弄清楚了如何使用我们正在生成的 headerStyle 设置每个标题列的样式,但无法弄清楚如何设置包含切换复选框。

似乎无法在文档中找到任何表明如何执行此操作的内容。

标签: javascriptreact-table

解决方案


我正在回答,但如果您的问题与此无关,那么您能用您的代码解释问题吗?

    columns={[

        {
           accessor: 'myAcc',
           Header: //any jsx or string here,
           getProps: () => getProps(redCell), // return CSS
           Cell: (rowInfo): JSX.Element => //you can render your jsx for the cell. 
        },
   ]}

推荐阅读