infinite-table / infinite-react

The modern React DataGrid for building apps — faster
https://infinite-table.com
73 stars 5 forks source link

Implement column flex sizing #9

Closed roblotter closed 2 years ago

roblotter commented 2 years ago

We need to implement column flex sizing, to behave similar to browser flex.

Example:

say infinite table is sized at 1000px and there are 3 columns:

Available flex size: 1000px - 400px = 600px. Column sizes:

The flex algorithm will distribute space like this: From the total available size, it will substract the fixed sizes: 1000px - 400px = 600px It will sum up all flex values: 1+2 = 3 It will compute the width of a flex unit: 600px / 3 = 200px It will distribute the flex space to every column, taking into account the flex value: col B = 2200px, col C = 1200px

roblotter commented 2 years ago

There are some other points to take into consideration:

roblotter commented 2 years ago

Implemented in 0.0.9 - adding docs very soon and will update and close this