How to format table with kable in Slidy Presentation in R Markdown?

Hi, I am running a chunk to create a table as shown below

``` {r compare.meta.metafor, echo=FALSE, cache=TRUE}
meta <- c('(+) Direct and straightforward implementation with minimal lines of code', '(+) Require a single-step workflow to perform a meta-analysis', '(+) Includes most general meta-analysis utilities (incl. meta-regression, interaction terms, modifiers, and Empirical Bayes estimators', '(+) Allows quantitative assessment of publication bias (e.g., Egger, Begg) using `metabias` function', '(-) Each data type require different functions (e.g., metabin, metacont, metaprop, metagen)', '(+) Two standout functions: `metagen` & `bubble.metareg`')
metafor <- c('(+) A more comprehensive meta-analysis package', '(-) Require an additional step (two-steps workflow) to calculate effect sizes a priori with `escalc` function', '(+) Includes most `meta` functions in addition to enhanced model-fitting capacities (e.g., log-likelihood estimates, AIC, BIC)', '(+) Allows trim-and-fill analysis with the `trimfill` function, in addition to quantitative assessments of publication bias', '(+) All meta-analysis models are built with `rma.uni` function', '(+) Standout function: Model-fitting functions')

compare.meta.metafor <- data.frame(meta, metafor)
kbl(compare.meta.metafor) %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"))

However, when I run the chunk, it seems that the table is not formatted (see image attached below)

Where did I go wrong?

Thank you very much for the help

Best,

hi,

Your code runs ok for me when I use 'kableExtra::kbl()'

JW

Thank you very much. It seems that the table format only works in HTML output but not in Slidy presentation. Is there a way to format a table in Slidy presentation?

You' re right, strange indeed as I would expect same HTML rendering for slides. Viewer shows formatting ok, but on slide it does not show. Unfortunately I cannot offer more help here as I never used slides from RMarkdown myself.

Hope someone else can give answer. Anyway, use kableExtra when using pipes.

Quick search on Google gave this Stackoverflow discussion. Probably what you might be looking for?

Missing KableExtra formatting in ioslides

gilbertlzrus Could you tell us if the answer by @user2553020 in the Stack Overflow page mentioned here solved your problem. The answer was to add a css file from bootstrap to the output specification for ioslides_presentation.

Thank you very much, I'll keep that in mind

Thank you very much @Jwvz001 and @padames . Yes, I can format the table in IOSlides. However, I seem to love the Slidy Presentation feature where we can click "A" to change from outline view to slide view. Is there a way to format the table in Slidy Presentation. Thank you very much in advance