Skip to content

Quarto Overrides Huxtable Styling With Bootstrap Theming  #7187

@mvanaman

Description

@mvanaman

Not sure if this is more of a Quarto or huxtable question. It is currently an open issue at huxtable, and at the request of the maintainer over there, I am reporting it here also .

Sadly, the new Quarto (>= 1.3) undoes some of huxtable formatting in favor of Quarto's bootstrapping table theming. I have tried for html format but not PDF. Here's an example:

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(huxtable)
#> 
#> Attaching package: 'huxtable'
#> The following object is masked from 'package:dplyr':
#> 
#>     add_rownames
iris %>% 
    head() %>% 
    huxtable() %>% 
    theme_article()
#> Warning in knit_print.huxtable(x, ...): Unrecognized output format "gfm-yaml". Using `to_screen` to print huxtables.
#> Set options("huxtable.knitr_output_format") manually to "latex", "html", "rtf", "docx", "pptx", "md" or "screen".
  ─────────────────────────────────────────────────────────────────────
   Sepal.Length   Sepal.Width   Petal.Length   Petal.Width   Species  
 ─────────────────────────────────────────────────────────────────────
            5.1           3.5            1.4           0.2   setosa   
            4.9           3              1.4           0.2   setosa   
            4.7           3.2            1.3           0.2   setosa   
            4.6           3.1            1.5           0.2   setosa   
            5             3.6            1.4           0.2   setosa   
            5.4           3.9            1.7           0.4   setosa   
 ─────────────────────────────────────────────────────────────────────
Column names: Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, Species

Created on 2023-10-09 with reprex v2.0.2

In the resulting html file, striping and probably other stuff I'm not noticing are changed, but so far I just notice striping. The expected output is for the table to resemble the theme_article() styling as shown here i.e., bold headers, no stripes.

This issue was noted in this stackoverflow question, but I found the solution unsatisfactory as it seems to break Quarto's tbl-cap: setting, at least for me.

System details
huxtable Version ‘5.5.2’
R Version 4.3.1 (2023-06-16)
Quarto Version 1.3
RStudio Version 2023.06.1+524 (2023.06.1+524)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthtmlIssues with HTML and related web technology (html/css/scss/js)tablesIssues with Tables including the gt integration

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions