as_word | R Documentation |
Get the Open Office XML table tag content from a gt_tbl
object as a
single-element character vector.
as_word(
data,
align = "center",
caption_location = c("top", "bottom", "embed"),
caption_align = "left",
split = FALSE,
keep_with_next = TRUE
)
data |
The gt table data object
This is the gt table object that is commonly created through use of the
|
align |
Table alignment
An option for table alignment. Can either be |
caption_location |
Caption location
Determines where the caption should be positioned. This can either be
|
caption_align |
Caption alignment Determines the alignment of the caption. This is
either |
split |
Allow splitting of a table row across pages
A logical value that indicates whether to activate the Word option
|
keep_with_next |
Keeping rows together
A logical value that indicates whether a table should use Word option
|
Use a subset of the gtcars
dataset to create a gt table. Add a header
with tab_header()
and then export the table as OOXML code for Word using
as_word()
tab_rtf <- gtcars |> dplyr::select(mfr, model) |> dplyr::slice(1:2) |> gt() |> tab_header( title = md("Data listing from **gtcars**"), subtitle = md("`gtcars` is an R dataset") ) |> as_word()
13-5
v0.7.0
(August 25, 2022)
Other table export functions:
as_gtable()
,
as_latex()
,
as_raw_html()
,
as_rtf()
,
extract_body()
,
extract_cells()
,
extract_summary()
,
gtsave()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.