From 16f2884cb83540cf25dc6cc5c868595d922b56c2 Mon Sep 17 00:00:00 2001 From: Lisec Date: Thu, 4 Jan 2024 09:03:58 +0100 Subject: [PATCH] Table column width adjustments. --- R/fnc_styleTabC3.R | 2 +- R/fnc_styleTabH1.R | 2 +- R/fnc_styleTabS1.R | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/fnc_styleTabC3.R b/R/fnc_styleTabC3.R index 3b7a454..dcdf331 100644 --- a/R/fnc_styleTabC3.R +++ b/R/fnc_styleTabC3.R @@ -50,7 +50,7 @@ styleTabC3 <- function(x, apm = NULL, selected_row = 1) { options = list( dom = "t", paging = FALSE, scrollX = TRUE, ordering = FALSE, columnDefs = list( - list("width"= paste0(max(c(60, nchar(as.character(x[,"analyte"]))*5)), "px"), "targets" = which(colnames(x) %in% c("analyte"))-1), + list("width"= paste0(max(c(60, nchar(as.character(x[,"analyte"]))*9)), "px"), "targets" = which(colnames(x) %in% c("analyte"))-1), list("width"= "80px", "targets" = which(!(colnames(x) %in% c("analyte","n","k","unit")))-1), list("width"= "30px", "targets" = which(colnames(x) %in% c("n","k"))-1) ) diff --git a/R/fnc_styleTabH1.R b/R/fnc_styleTabH1.R index 85e6b39..67baef3 100644 --- a/R/fnc_styleTabH1.R +++ b/R/fnc_styleTabH1.R @@ -61,7 +61,7 @@ styleTabH1 <- function(x, mt = NULL, prec = NULL, output = c("df", "dt")[1], cr options = list( dom = "t", paging = FALSE, searching = FALSE, ordering = FALSE, columnDefs = list( - list("width"= paste0(max(c(60, nchar(as.character(x[,"analyte"]))*5)), "px"), "targets" = which(colnames(x) %in% c("analyte"))-1), + list("width"= paste0(max(c(60, nchar(as.character(x[,"analyte"]))*9)), "px"), "targets" = which(colnames(x) %in% c("analyte"))-1), list("width"= "60px", "targets" = which(!(colnames(x) %in% c("analyte", " ", "n", "N")))-1), list("width"= "30px", "targets" = which(colnames(x) %in% c("n", "N"))-1), list(visible = FALSE, targets = inv_cols), diff --git a/R/fnc_styleTabS1.R b/R/fnc_styleTabS1.R index 6ac2944..050275a 100644 --- a/R/fnc_styleTabS1.R +++ b/R/fnc_styleTabS1.R @@ -36,7 +36,7 @@ styleTabS1 <- function(x, mt = NULL, sr = 1) { options = list( dom = "t", paging = FALSE, searching = FALSE, ordering = FALSE, columnDefs = list( - list("width"= paste0(max(c(60, nchar(as.character(x[,"analyte"]))*5)), "px"), "targets" = which(colnames(x) %in% c("analyte"))-1), + list("width"= paste0(max(c(60, nchar(as.character(x[,"analyte"]))*9)), "px"), "targets" = which(colnames(x) %in% c("analyte"))-1), list("width"= "60px", "targets" = which(!(colnames(x) %in% c("analyte", " ")))-1), #list("width"= "30px", "targets" = which(colnames(x) %in% c("n", "N"))-1), list(visible = FALSE, targets = inv_cols),