-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let huxtable use markdown #885
Comments
Can you give an example how the markdown function is used? How would I go about allowing markdown for the header rows in the example below? trial %>%
select(age) %>%
tbl_summary() %>%
as_tibble() %>%
huxtable::as_huxtable(add_colnames = FALSE) %>%
huxtable::insert_row(after = 0,
label = "**Characteristic**",
stat_0 = "**N = 200**") %>%
huxtable::set_markdown(row = 1) |
Last line should be |
Thanks! I'll add it to the list of things to do. Some notes for myself.... I think all I need to do is add the one line above to the huxtable calls. When there is a spanning header, then I'll likely need to include library(gtsummary)
tbl <-
trial %>%
select(age, trt) %>%
tbl_summary(by = trt) %>%
as_hux_table(strip_md_bold = FALSE) %>%
huxtable::set_markdown(row = 1, col = huxtable::everywhere, value = TRUE) |
Since version 5.0.0, huxtable supports markdown within table cells with the
set_markdown()
functionality:Describe the solution you'd like
as_hux_table
should setstrip_md_bold = FALSE
by default, and probably this option could be deprecated. Cells containing markdown should haveset_markdown(TRUE)
set on them.Additional context
I'd make a pull request myself, but I have to be honest - I find the gtsummary code really hard to get my head around! I suspect you could do this much faster than I can, but if you don't have time, tell me and I will try.
The text was updated successfully, but these errors were encountered: