Skip to content

Instantly share code, notes, and snippets.

@nassimhaddad
Created November 25, 2015 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nassimhaddad/5514a844328f91f99191 to your computer and use it in GitHub Desktop.
Save nassimhaddad/5514a844328f91f99191 to your computer and use it in GitHub Desktop.
coloring cells using rhandsontable
DF = data.frame(
title = 1:4,
dummy = rep(NA, 4),
desc = c("1", "2", "3",
'<span style="width:100px;height:100px;background:#354B96;display:inline-block;color:white;">5</span>'),
stringsAsFactors = FALSE
)
library(rhandsontable)
rhandsontable(DF, allowedTags = "<em><b><span><strong><a><big>",
width = 800, height = 500, rowHeaders = FALSE) %>%
hot_cols(colWidths = c(200, 200, 100)) %>%
hot_col(1:3, renderer = NULL) %>%
hot_col(1:3, renderer = htmlwidgets::JS("safeHtmlRenderer"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment