Reputation: 11
I am using DataTable in primeReact, to render some data, I would like to make it display to full size of the window. table size only matches the data size. here's my code.
<div style={{ padding: '0rem 1rem 1rem 1rem' }}>
<DataTable value={attributes}
showGridlines
stripedRows
resizableColumns
columnResizeMode="fit"
paginator
rows={12}>
<Column field="name" header="Name"></Column>
<Column field="displayName" header="Display Name"></Column>
<Column field="headerName" header="Header Name"></Column>
<Column field="editable" header="Editable" body={editableBodyTemplate}></Column>
<Column field="isDefault" header="Is Default" body={isDefaultBodyTemplate}></Column>
</DataTable>
</div>
Upvotes: 1
Views: 2197
Reputation: 324
you should add a style={{minHeight: '95vh'}}
property to the DataTable element :)
Upvotes: 1