-
Notifications
You must be signed in to change notification settings - Fork 218
Closed
Labels
Milestone
Description
hi,
Setting the tab_options(table.width = pct(100)) does not seem to have the desired effect when creating pdfs.
---
title: "Test"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(gt)
library(tidyverse)
library(glue)
# Define the start and end dates for the data range
start_date <- "2010-06-07"
end_date <- "2010-06-14"
# Create a gt table based on preprocessed
# `sp500` table data
sp500 %>%
dplyr::filter(date >= start_date & date <= end_date) %>%
dplyr::select(-adj_close) %>%
gt() %>%
tab_header(
title = "S&P 500",
subtitle = glue::glue("{start_date} to {end_date}")
) %>%
fmt_date(
columns = vars(date),
date_style = 3
) %>%
fmt_currency(
columns = vars(open, high, low, close),
currency = "USD"
) %>%
fmt_number(
columns = vars(volume),
suffixing = TRUE
) %>% tab_options(
table.width = pct(100)
)
NenuialBrennanHickson
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done