diff --git a/R/toTinytable.R b/R/toTinytable.R index 6af20d7..7ee5985 100644 --- a/R/toTinytable.R +++ b/R/toTinytable.R @@ -58,7 +58,8 @@ toTinytable <- function(table, ...) { # entries in the first row of clabels are already colnames in out if (nrow(clabels) > 1) { spans <- rev(apply(clabels, 1, get_span)[1:(nrow(clabels) - 1)]) - for (s in spans) { + for (i in (nrow(clabels) - 1):1) { + s <- get_span(clabels[i,]) out <- tinytable::group_tt(out, j = s) } }