library(huxtable) knitr::opts_chunk$set(echo = FALSE)
make <- function(nrow = 2, ncol = 2, text1 = 'Some text', text2 = 'Some more text', more_text = 'Some text') { ht <- hux(a = rep(text1, nrow), b = rep(text2, nrow), add_colnames = FALSE) for (i in seq_len(ncol -2)) { ht <- cbind(ht, rep(more_text[i], nrow)) } ht <- set_all_borders(ht, 1) ht <- set_background_color(ht, odds, everywhere, 'orange') ht <- set_background_color(ht, evens, everywhere, 'green') ht <- set_tabular_environment(ht, "tabular") ht } long <- 'A rather long row of text which goes on...'
ht <- as_hux(head(mtcars, 1)) ht
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.