I'm converting an R DT table to an html widget.
The widgets have the annoying carriage return symbols. Example of carriage return issue:
The dataframe is all_p_22
My code:
library(htmlwidgets)
library(DT)
tab10a <- datatable(all_p_22,
filter = 'top',
options = list(
dom = "Bfrtip",
pageLength = 120,
autoWidth = TRUE,
buttons = c("csv","excel")),
rownames = FALSE,
caption = htmltools::tags$caption(style = 'caption-side: top; text-align: center; color:black; font-size:150%;',
'Table 10a: Overall Legislative Assembly result by party'),
class = 'cell-border stripe',
extensions = c("Buttons","Responsive"))
tab10a1 <- tab10a %>%
formatRound("Sum Votes",
digits = 0,
interval = 3,
mark = ",") %>%
formatRound("Per cent",
digits = 2,
mark = ",")
saveWidget(tab10a1,"tab10a.html")
Tried minor fixes such as removing buttons but had no effect.