From 8d6f64fa233c4f89aa92c5333379ebd3d73df653 Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sat, 16 Nov 2024 19:29:23 -0500 Subject: [PATCH] tabularray_inner at the end of styles --- R/style_tabularray.R | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/R/style_tabularray.R b/R/style_tabularray.R index 375c0d28..5d704178 100644 --- a/R/style_tabularray.R +++ b/R/style_tabularray.R @@ -38,14 +38,6 @@ setMethod( sty$alignv[which(sty$alignv == "t")] <- "h" sty$alignv[which(sty$alignv == "m")] <- "m" - for (spec in stats::na.omit(sty$tabularray_inner)) { - x@table_string <- tabularray_insert(x@table_string, content = spec, type = "inner") - } - - for (spec in stats::na.omit(sty$tabularray_outer)) { - x@table_string <- tabularray_insert(x@table_string, content = spec, type = "inner") - } - set <- span <- rep("", nrow(rec)) # d-column are column-wise, so we treat them here @@ -236,6 +228,15 @@ setMethod( x@table_string <- tabularray_insert(x@table_string, content = s, type = "inner") } + for (spec in unique(stats::na.omit(sty$tabularray_inner))) { + x@table_string <- tabularray_insert(x@table_string, content = spec, type = "inner") + } + + for (spec in stats::na.omit(sty$tabularray_outer)) { + x@table_string <- tabularray_insert(x@table_string, content = spec, type = "inner") + } + + return(x) })