Hello all. Complete rookie here.
I have many users of reports I generate using datatables that want to copy/paste my tables into Word and Excel, but don't have Excel formatting skills.
I'd like to help them out by customizing the output of the copy
button to include formatting that will include cell borders (pipe dream: bold headers).
I have no real javascript experience, but use RStudio, and the following code to generate my table.
datatable(data1,class='cell-border',extensions='Buttons',rownames=FALSE,filter=c("top"),options=list(dom='Blfrtip',buttons=list(list(extend='copy',exportOptions=list(modifier=list(page='current'),exportData=list(stripHtml=list('false')))))))
**Debugger code (debug.datatables.net)**:
**Error messages shown**:
**Description of problem**:
I've seen that there are format.header and format.body here: https://datatables.net/reference/api/buttons.exportData()
but cannot find an example where cell borders are a part of the formatting that happens.
Is there a means of doing this, especially that might play nicely with the R version of coding?
I've asked a simarly question on stack overflow here: https://stackoverflow.com/questions/66784020/how-can-i-add-a-table-to-my-rmarkdown-html-output-that-will-paste-into-excel-wit but with no answers.