primereact如何在DataTable设置滑动,让表头始终在顶部
设置DataTable样式:
overflowY: "scroll"
具体:
<DataTable
value={excelData}
style={{ height: '80vh', width: "90vw", display: "flex", flexDirection: "column", overflowY: "scroll" }}
scrollable>
{headersData2.map((headerItem) => {
if (headerItem.isSelect) {
return <Column key={headerItem.key} field={headerItem.key} header={headerItem.label} />
}
})}
</DataTable>