Skip to content

Commit

Permalink
conditional styling
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jan 13, 2024
1 parent 9702009 commit 93bbe8e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vignettes/tutorial.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,19 @@ tt(dat) |>
"They love tofu" = 7))
```

## Conditional styling

We can use the standard `which` function from Base `R` to create indices and apply conditional stying on rows. And we can use a regular expression in `j` to apply conditional styling on columns:

```{r}
mtcars[1:10, 1:5] |>
tt() |>
style_tt(
i = which(dat$gear > dat$carb),
j = "mpg|hp",
background = "lightgreen")
```


# HTML customization

Expand Down

0 comments on commit 93bbe8e

Please sign in to comment.