0

How to set the size of the final table created using react-data-grid.

For example if I want a 250*250 px size table, how to do that.

Is there any props already available for that? or it needs to be done using the pure CSS.


After solution provided by Saurav

enter image description here

SHUBHAM DEKATE
  • 95
  • 3
  • 14

1 Answers1

1

You can use something like this

this.dynamicHeight = 250px;
this.dyanmicWidth = 250px
<ReactDataGrid
minHeight={dynamicHeight}
minWidth={dynamicWidth}
...
/>

I hope this helps.

saurav singh
  • 438
  • 6
  • 16
  • Hi Saurav thanks for the reply , I did pass above two as a props to the component, and it worked however I am facing two issues right now. 1. there is an empty space at the right and bottom of the grid and 2. How to resize the text inside grid according to grid size – SHUBHAM DEKATE Jul 02 '20 at 11:33
  • I have added the screenshot above – SHUBHAM DEKATE Jul 02 '20 at 11:34