I'm using dynamic columns in PrimeReact Datatable component:
const columns = [
{
field: 'code',
header: 'Code',
body: bodyTemplate,
headerStyle: {{minWidth: '15rem'}},
sortable: 'sortable',
},
...
]
I defined bodyTemplate as:
const bodyTemplate = (rowData) => {
return (
<>
<span className='p-column-title'>Code</span>
{rowData.code}
</>
)
}
But I don't know how to define headerStyle. Is it possible and how can I do that in dynamic columns?