Skip to content

Commit

Permalink
themes bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Oct 15, 2024
1 parent ab5ccc2 commit a58bf76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion R/style_bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ style_apply_bootstrap <- function(x) {
x@bootstrap_class <- last_style_vec(sty$bootstrap_class)
}


sty$alignv[which(sty$alignv == "t")] <- "top"
sty$alignv[which(sty$alignv == "b")] <- "bottom"
sty$alignv[which(sty$alignv == "m")] <- "middle"
Expand Down
12 changes: 7 additions & 5 deletions R/tt_bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,18 @@ setMethod(
# before style_eval()
x@table_string <- out

if (is.null(x@theme[[1]]) || is.function(x@theme[[1]]) || isTRUE("default" %in% x@theme[[1]])) {
if (length(x@bootstrap_class) == 0) {
if (is.null(x@theme[[1]]) || is.function(x@theme[[1]]) || isTRUE("default" %in% x@theme[[1]])) {
x <- theme_tt(x, "default")
}
} else if ("bootstrap" %in% x@theme[[1]]) {
x <- style_tt(x, bootstrap_class = "table")
x <- style_tt(x, bootstrap_class = "table")
} else if ("striped" %in% x@theme[[1]]) {
x <- style_tt(x, bootstrap_class = "table table-striped")
x <- style_tt(x, bootstrap_class = "table table-striped")
} else if ("grid" %in% x@theme[[1]]) {
x <- style_tt(x, bootstrap_class = "table table-bordered")
x <- style_tt(x, bootstrap_class = "table table-bordered")
} else if ("void" %in% x@theme[[1]]) {
x <- style_tt(x, bootstrap_class = "table table-borderless")
x <- style_tt(x, bootstrap_class = "table table-borderless")
}

if (length(x@width) > 1) {
Expand Down

0 comments on commit a58bf76

Please sign in to comment.