ipydatagrid icon indicating copy to clipboard operation
ipydatagrid copied to clipboard

Automatically resizing the row height, based on biggest cell.

Open CYee3589 opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. No. I would like to know if such a feature currently exists, or is there any work around. It's frustrating to have a row only show the first line of a long str of cell data when using text_wrap=True. Sure I could resize all the rows to make them bigger, but most of the rows don't have a long str of cells, hence it would be a waste of space to give those rows bigger dimensions.

Describe the solution you'd like Any functional solution would suffice, as long as it doesn't involve hard-coding the heights of these rows (since the data that I'm using is constantly being added and updated). Preferably though, it would like to have a boolean parameter to indicate automatic row height scaling. For example: with a row that has 4 new lines worth of characters given my default datagrid settings, I would the the program to automatically resize the height of that specific row to fit the string, keeping the string's font size and cell's column size (this should apply to all rows that have this problem).

Describe alternatives you've considered One alternative I have is to shrink the font size of the cell's contents, so that the string can scale with the given the cell's size. For example: with a row that has 4 new lines worth of characters given my default datagrid settings, I would like the program to automatically change that specific cell's string's font size to show all the string's contents in the given space (this should also apply to all cells that have this problem). I would prefer my first solution, since shrinking the font would sometimes make that cell's string's contents illegible.

Additional context I'm implementing a ipydatagrid object into a python shiny app, and using the shiny and shinywidget library in python. The main reason why I'm choosing a ipydatagrid ui object instead of the builtin shiny output_data_frame ui object is because ipydatagrid provides more customizations.

CYee3589 avatar Sep 27 '23 18:09 CYee3589

What is the status of this issue? I've a similar use case: displaying large strings on a table in shiny python. At the moment trying to use text_wrap=True or re-sizing the table does not seem to have any effet.

smartinsightsfromdata avatar Feb 03 '24 12:02 smartinsightsfromdata