I'm able to export a DT table generated in R/RStudio to HTML using the htmlWidget:saveWidget method. However, the FixedColumns feature is not preserved and becomes very narrow when a term is entered in the search bar.
xyz_search_dt <- datatable(
xyz_search_table_d,
rownames = FALSE, extensions = 'Buttons',
options = list(autoWidth = TRUE,
extensions = 'FixedColumns',
options = list(dom = 't',scrollX = TRUE,
fixedColumns = TRUE),
columnDefs = list(list(width= '200px',
targets = "feedback")),
dom=('Bfrtip'), buttons = c('excel'),
pageLength = table_rows,
searchHighlight = TRUE),
filter = list(position="top"))
htmlwidgets::saveWidget(xyz_search_dt, "xyz_search_dt.html")