Journal asking for an editable table

Hi all,
I created two tables with the gt package and was very pleased with the look of the tables - and the learning process. My manuscript was accepted and now I received a notice that the tables need to be in editable format, like a Word table.

Is that a way for me to save the table in a text format rather than copy-pasting in to Word?

Thanks for your help.

The pandoc program can convert HTML to all but the most obscure editable formats. It’s buried somewhere with RStudio or you can download a CLI standalone at its website or cut and paste the HTML to their online converter.

1 Like

gtsave() claims to be able to save a gt object as rtf or docx.

1 Like

Hi, Thanks so much for the reply. I found where they buried pandoc :). Here is what worked for me - but I lost the beauty of the gt table.

library(rmarkdown) #to call Pandoc
tab %>% gtsave(filename = "Table1.html")
pandoc_convert("Table1.html", to = "docx", output = "Table1.docx")

Thanks for your help.

1 Like

Thanks for the tip. I wasn't able to use it as my employer owns the Word license.

To convert your tables created with the gt package into an editable format like a Word table, you have a couple of options. One approach is to export the tables as CSV files, which can be opened and edited in spreadsheet software like Microsoft Excel. Once opened in Excel, you can copy and paste the table into a Word document as a native Word table. Another option is to directly export the tables to Excel using the gt package's write_xlsx() or write_csv() functions. Thanks


Thank you. I will try it with another table I am working on now.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.