-
-
Notifications
You must be signed in to change notification settings - Fork 152
Open
Description
Describe the bug
If I use pack_rows(), the left aligned footnote becomes centre-aligned on the 1st column instead. When pack_rows() is not used the footnote becomes left-aligned again.
#| tbl-cap: "Summary statistics."
#| echo: false
#| message: false
#| warning: false
library(knitr)
library(kableExtra)
library(glue)
sample_size <- nrow(df) # get sample size dynamically
summary_df %>%
kbl(
col.names = c("", "Mean", "Std Dev"),
row.names = FALSE,
align = "lrr",
escape = FALSE
) %>%
kable_paper(font_size = 6) %>%
column_spec(1, width = "80%") %>%
column_spec(2, width = "10%") %>%
column_spec(3, width = "10%") %>%
pack_rows(index = c("Key variables" = 4, "Control variables" = 18)) %>%
# pack_rows("Key variables", 1, 4) %>%
# pack_rows("Control variables", 5, 22) %>%
footnote(general = glue("The summary statistics are calculated from the estimation sample of morning commutes. The sample size is {sample_size}.")
)
Metadata
Metadata
Assignees
Labels
No labels