Tien
Tien

Reputation: 11

Table with kableExtra

I want to make the table as in the picture using kableExtra.

enter image description here

I am trying to use the R code chunk below, but I get unexpected result. Could you please show me how to fix it?

```{r, echo=FALSE}
library(kableExtra)
df <- data.frame(
  Operator = c("`==`", "`!=`", "`>`", "`<`", "`>=`", "`<=`"),
  Interpretation = c("Equal to", "Not equal to", "Greater than", "Less than", "Greater than or equal to", "Less than or equal to")
)
df %>% kbl() %>% kable_styling(bootstrap_options = c('striped', 'hover', 'condensed'))
```

enter image description here

Upvotes: 1

Views: 205

Answers (1)

Yacine Hajji
Yacine Hajji

Reputation: 1449

This is the closest I could do

library(kableExtra)

df <- data.frame(
  Operator = c("==", "!=", ">", "<", ">=", "<="),
  Interpretation = c("Equal to", "Not equal to", "Greater than", "Less than", "Greater than or equal to", "Less than or equal to")
)

df %>% 
  kbl() %>% 
  kable_classic(full_width=F, html_font="Cambria") %>% 
  row_spec(0, bold=TRUE)

enter image description here

Upvotes: 2

Related Questions