Skip to content

Gt to word - #962

Merged
rich-iannone merged 90 commits into
rstudio:masterfrom
thebioengineer:gt_to_word
Jul 5, 2022
Merged

rich-iannone merged 90 commits into
rstudio:masterfrom
thebioengineer:gt_to_word

Conversation

@thebioengineer

Copy link
Copy Markdown
Collaborator

Summary

Thank you for contributing to gt! To make this process easier for everyone, please explain the context and purpose of your contribution. Also, list the changes made to the existing code or documentation.

The changes here add to the gt_to_word branch developed by rich to add some additional features. I am opening this PR to facilitate discussion. We could also change this PR to merge into your gt_to_word branch if you would rather compare against that. I have merged in the main branch into my fork.

In summary, the changes in this branch are as follow:

  • as_word() function which converts gt objects to ooxml, which can then be inserted into word documents
  • body_add_gt() function which gives the ability to add gt objects to a docxr object from {officer}

I did not add capabilities from a formatting standpoint from what was already in the branch. known features to add include:

  • multiple levels of spanning columns
  • filling cells with color (tabl_style/cell_style)

Related GitHub Issues and PRs

Checklist

@cscheid cscheid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@rich-iannone rich-iannone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@rich-iannone
rich-iannone merged commit a585bd6 into rstudio:master Jul 5, 2022
@thebioengineer
thebioengineer deleted the gt_to_word branch July 5, 2022 20:55
@raffaelemancuso

raffaelemancuso commented Jul 25, 2025 •

Copy link
Copy Markdown

Sorry, is this only for Quarto output or can I use this to add a gt table to an officer object?

Because I don't find a body_add_gt() function in the guide.

I found a body_add_gt function in an external package

@thebioengineer

Copy link
Copy Markdown
Collaborator Author

I wrote gto to support gt working with officer. So go ahead with that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants