dash-table icon indicating copy to clipboard operation
dash-table copied to clipboard

fixed_columns causes issues with header alignment and overflowx

Open zach-morris opened this issue 3 years ago • 0 comments

I'm attempting to generate a datatable with two fixed_columns and one fixed_row (header). The total number of columns requires overflowX (auto) typically so the user scrolls to see additional columns.

With fixed_columns enabled ({'headers':True,'data':2}), if I also have a header fixed_row ({'headers':True,'data':0}), then the header row is misaligned slightly:

fixed_columns enabled (see top right corner of row header): fixed_columns_on_a

fixed_columns disable fixed_columns_off_a

Additionally, if the table is several columns in length and the data overflowX's, then the behavior is incorrect if fixed_columns is enabled or disabled. With fixed_columns enabled, then the table does not adhere to it's size parameters and auto shrinks to a small size (without including 'minWidth':'100%' to the style_table, the table looks like this): min_width_off_fixed_col_on_a

From the forums, a trick is to add 'minWidth':'100%' to the style_table, which helps with the size, however the overflowX is incorrect now. With fixed_columns enabled, the overflow scroll goes off into infinity (I think?), well past the actual size of the data columns in the table.

fixed_columns enabled ( 'minWidth':'100%' , see scroll bars on table - scrolling goes well past the table data): fixed_col_on_large_table_a

fixed_columns disabled ( 'minWidth':'100%' ): fixed_col_off_large_table_a

zach-morris avatar Dec 15 '22 16:12 zach-morris