R/style_spanner.R

Defines functions style_spanner

Documented in style_spanner

#' Style a spanner
#'
#' @param table an gt_tbl
#' @param format formatting
#' @export
#' @return a data frame
#' @importFrom gt cells_column_labels
#' @importFrom dplyr everything
#' @importFrom gt tab_style
#' @importFrom gt cells_column_spanners
#' @importFrom dplyr everything
#' @importFrom gt tab_style

style_spanner <- function(table,format){

  # browser()

  if(is.list(format$location)){
   # At some point check that this evaluatuates to a spanner location
    return(table)
  }

  tab_style(data = table,
            style = format$format_list[[1]],
            locations =cells_column_spanners(spanners = everything()))
}
ianmoran11/mmtable2 documentation built on Dec. 20, 2021, 5:58 p.m.