set_formatter_star | R Documentation |
Set star rating formatter
set_formatter_star(widget, column, number_of_stars = NA, hoz_align = "center")
widget |
A |
column |
The name of the column the formatter is applied to. |
number_of_stars |
The maximum number of stars to be displayed.
If set to |
hoz_align |
(character): The horizontal alignment of the column. |
The updated tabulator()
HTML widget
data <- data.frame(
Passengers = c("Hans", "Franz", "Ferdinand", "Julia"),
PassengerClass = c(1, 2, 1, 3)
)
tabulator(data, width = 200) |>
set_formatter_star("PassengerClass", number_of_stars = max(data$PassengerClass))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.