minCellWidth is not respected when using colspan other than 1
See original GitHub issueHere’s my example, I need an explanation of this behavior and possible solution.
The layout consists of 6 logical columns (but because there is not enough data the last visual column took all remaining ones using colspan, for example Multi File Upload has colspan of 3 and A or B Single took a colspan of 2)
The whole table has width of 190, every visual column has minCellWidth of 22.62, except for Multi Image which was set to 67.5.
Multi Image
const paramCell: CellDef = {
colSpan: 2,
styles: { minCellWidth: 67.5, cellPadding: 1.76},
};
The issue is, it didn’t get it’s 67.5 but gets 62.1284178912133 for some unintuitive reason.
Even when I try to set it manually in didParseCell
or willDrawCell
it still is being rendered with less width and image gets cut.
const cellWidth = data.cell.width;
const minCellWidth = (data.cell.raw as CellDef).styles.minCellWidth;
data.cell.width = cellWidth < minCellWidth ? minCellWidth : cellWidth;
I don’t understand why doesn’t it get it’s desired width!? 190 - 22.62 * 5= 76.9, which is higher than 67.5, meaning that there’s still some space left after giving every visual column it’s desired minCellWidth
And why setting width manually also doesn’t work…
My suspicions are that next rows somehow override values, making previous rows to recalculate stuff wrong.
P.S. If I set colspan of Multi Images to 1, the minCellWidth is respected (but the whole layout gets logically broken)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (2 by maintainers)
Top GitHub Comments
This issue has been automatically closed since the issues in this project are mainly used for bugs and feature requests. Questions are directed to stackoverflow.
@simonbengtsson review PR please.