Get Free Trial

Reduce column width

Answered
Filip Osselaere asked on April 29, 2021

Hello,
 
Is there a way to reduce the column width, in case of long column headers?
E.g. by changing the alignment of the column header text (horizontal to vertical).
 
Kind regards,
Filip

1 answer

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 30, 2021

Hello, Filip,
 
Thank you for reaching out to us.
 
You can limit the width of all the columns on the grid using the following CSS rule:

:root {
--column-width: 200px; /* Desired maximum width */
}

#fm-pivot-view .fm-grid-column,
#fm-pivot-view .fm-grid-column-mobile {
max-width: var(--column-width);
}

Please see the JSFiddle for the demonstration.
 
If more specific adjustment is required, you may use the tableSizes object and adjust columns’ width based on the index/hierarchy: https://jsfiddle.net/flexmonster/b0tzp8c5/.
 
In both cases, the long field’s/member’s name will be trimmed.
 
Concerning vertical text orientation, we want to explain that Flexmonster does not support this option.
 
Please let us know if the proposed solution works for you.
 
Kind regards,
Illia

Please login or Register to Submit Answer