Skip to content

Implement column flex sizing #9

@roblotter

Description

@roblotter

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:

  • 1 fixed column with width: 400px - col A
  • 1 flex column with flex: 2 - col B
  • 1 flex column with flex: 1 - col C

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

  • col A - 400px
  • col B - 400px
  • col C - 200px

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions