opened
pmaji
username_0
Presently, within R Shiny, when building a "renderFormattable({   })" table, I see no way of avoiding manually calling column names. In the code snippet below (cut for size so it's incomplete) the **bolded** items are the exact column names. It would be great if instead I could replace, for example, "assetportfolio_rate_of_return" with names(port_summary_table)[1], or some such other way of dynamically calling names. The status quo makes it very difficult to control column names, and prevents me from using, just as an example, any column names that contain spaces. 

How can this be fixed circumvented @renkun-ken ? For reference, the code that uses this is located here (https://github.com/username_0/crypto-asset-comparison-tool/blob/master/app.R). 

formattable(_port_summary_table_, 
                    list(
                      **asset_portfolio_rate_of_return** = formatter("span",
                                                                 style = x ~ style(
                                                                   display = "inline-block",
                                                                   direction = "rtl",
                                                                   "border-radius" = "4px",
                                                                   "padding-right" = "2px",
                                                                   "background-color" = csscolor("darkslategray"),
                                                                   width = percent(proportion(x)),
                                                                   color = csscolor(gradient(x, "red", "green"))
                                                                 )),
                      **asset_portfolio_absolute_profit** = formatter("span",
                                                                  style = x ~ style(
                                                                    display = "inline-block",
                                                                    direction = "rtl",
                                                                    "border-radius" = "4px",
                                                                    "padding-right" = "2px",
                                                                    "background-color" = csscolor("darkslategray"),
                                                                    width = percent(proportion(x)),
                                                                    color = csscolor(gradient(x, "red", "green"))
                                                                  )),
support for dynamic column names?
issue
closed
pmaji
username_0
issue