Closed PaulinCharliquart closed 5 months ago
Hello Paulin,
I don't think it's possible.
See https://davidgohel.github.io/flextable/reference/knit_print.flextable.html#html-output. Shadow dom is used to isolate rendering from the other styles (for example quarto styles). So even if your CSS class is defined, it won't influence the result.
What is doing your CSS class? What style is necessary that is not feasible with flextable API or default settings? I can help if I know what you want to achieve :)
Thanks for your quick reply! I will need the css class for some JavaScript functions in my shiny apps. Anyway, I found a quick solution:
tb <- flextable::htmltools_value(ft)
tb[[3]] <- gsub('class="tabwid"', 'class="tabwid rtables"', tb[[3]])
tb
regards
If your JS functions manipulate flextable content, you can select them with .tabwid
, no need to add a class for that!
hi,
When using
htmltools_value
to exportflextable
to html, it will be nice to have an option to define additional css class. For example with a small modification of https://github.com/davidgohel/flextable/blob/HEAD/R/printers.R:Expected output:
What do you think? I can create a pull request if need.
thanks
Paulin