-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Calling colformat_md()
on header rows removes labels?
#71
Comments
Thank you for opening the issue.
I will give a try to improve, but am not sure when. |
Thank you so much for the response! In the meantime, I don't think it would be too much work on my end to use formatted column names instead of using flextable column header labels. |
Quick update: I began to make the update above (using the column names instead of using the column labels defined in felxtable). BUT, I realized this won't work with the spanning headers. Is there a way to make the additional headers use markdown syntax? |
Thanks for the update. The fix on #61 will also support the spanning headers. I also have started working on this issue and #61 this morning, and I think I guess I can make things happen in this week. tibble::tibble(
`x_**b**` = c("**bold**", "*italic*"),
y = c("^superscript^", "~subscript~"),
z = c("***~ft~^Extra^** is*", "*Cool*")
) %>%
as_flextable() %>%
span_header(sep="_") %>%
colformat_md(part = "all") |
That is fantastic! Thank you! |
Wow, it's beautiful! You're so good! 😍 |
@ddsjoberg Would you try |
@atusy ! This is amazing! I did some testing, and everything seems to work perfectly. I think I'll implement in gtsummary with the following lines. If you have any suggestions, please do let me know! library(gtsummary)
packageVersion("gtsummary")
#> [1] '1.5.2'
packageVersion("ftExtra")
#> [1] '0.3.0.9999'
tbl <-
trial %>%
select(marker, trt) %>%
tbl_summary(by = trt) %>%
modify_spanning_header(all_stat_cols() ~ "***Treatment***\nsecond line") %>%
modify_footnote(label = "Testing *italic* and **bold**") %>%
as_flex_table(strip_md_bold = FALSE) %>%
ftExtra::colformat_md(part = "header", md_extensions = "+hard_line_breaks") Created on 2022-04-18 by the reprex package (v2.0.1) Thank you for the wonderful package! I am planning a gtsummary release in the next couple of weeks. Do you have an idea of when you'll push these updates to CRAN? I think it'll be great to include them! |
Thank you for the quick reaction! I am happy to hear the nice result! About the CRAN release, I will plan in this week. |
Thanks for the fix! I will try this tomorrow. |
Thanks! |
Hello! I recently came across your package, and it's awesome! Thank you for your dev work.
I maintain a package called gtsummary that creates summary tables that can be exported as a flextable. I use markdown syntax in the headers that is supported by other output types gt and huxtable. I would like to utilize your package to add support for the markdown syntax in the headers of the flextables too.
I've played around with the
ftExtra::colformat_md(part = "header")
function to try and use markdown in the header.Is it possible to utilize the function in this way (aka on column header labels) to use markdown bold syntax in the header, or do I need to rename the underlying columns to use this function on the headers?
Thank you!
Created on 2022-04-16 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: