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


hughjonesd/huxtable documentation built on Feb. 17, 2024, 12:20 a.m.