marimo
marimo copied to clipboard
Ability to style / format mo.ui.table()
Description
Would be great to be able to format the output of mo.ui.table().
As an example to be able to add decimals, format numbers as percentages, datetime formating etc...
This is the current output.
Suggested solution
A suggested solution would be to add the ability to handle pd options display like pd.options.display.float_format = "{:,.2f}".format.
Alternative
No response
Additional context
No response
This would be extremely useful!
It would be especially helpful for datetime formatting, as there doesn't seem to be any way to customize the display of dates in the table. At least for numbers, you can make them into strings to customize the number of decimal places, but any method of attempting to convert a datetime to a string leads to the table displaying it the same way.
Having a way to customize the default datetime formatting would be a good solution I believe, or possibly a way to disable automatic datetime identification per column.
Example:
@Norvie, @aopell would appreciate your thoughts:
- Do you want to format this programmatically? E.g. passing format options to the table. or do this on the frontend with the dropdown (this wont be persisted across into the application code)? or both?
- Do you want to do this per table (.e.g
float_format,data_format) or per column?
Hi @mscolnick
In my humble opinion :)
- Both
- Per column