I'm using formattable and DT together in order to create a custom table, while still being able to edit the cell values (using editable=T, from DT).
The problem is that if I use formattable() to make a custom table, whenever I double click on a cell to edit its content, it will show the HTML code instead of the simple value.
Here an example:
library(formattable)
library(DT)
products <- data.frame(id = 1:5,
price = c(10, 15, 12, 8, 9),
rating = c(5, 4, 4, 3, 4),
market_share = percent(c(0.1, 0.12, 0.05, 0.03, 0.14)),
revenue = accounting(c(55000, 36400, 12000, -25000, 98100)),
profit = accounting(c(25300, 11500, -8200, -46000, 65000)))
f_table <- formattable(products, list(
price = color_tile("transparent", "lightpink")))
as.datatable(f_table, editable=T)
# as.datatable is from formattable, it lets you keep the table styling
Here you can see the problem:
Is there a simple way to fix this?


