I start with an empty table. Users can type integers, floats and text in any cell and also add rows and columns at will. Based on the data in the cells, I’d like to format. For example, no trailing zeroes for integers. For floats, round to two decimals, right align etc.
I tried setting the formats in cells function, but it gets slow, because I’ve to check the data type for each cell and set the styling and formatting accordingly.
Just change the way it looks, not the underlying the data (if that is possible).
My use case is this:
Users start with empty table, and they type/change any value in any cell. I have no way of knowing what value is going to be in a cell. I’d like to put some basic rules in place - if a cell has a number, then right align it and force two decimal places. But if the user changes the same cell to a text, then left align it.
I tried it with “Cells” function - basically tested each value for ints, floats and text and changed the cellProperties object. It works, but for large tables it won’t be usable (like if the user copy pastes 200 cells, then I’ve to check all 200).