From 9b1037d7f26a8cb11105eb3c2e5c4737f6106001 Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sat, 13 Jan 2024 19:04:54 -0500 Subject: [PATCH] width bugfix --- R/tt_bootstrap.R | 3 +- inst/templates/bootstrap.html | 53 ++++++++++++++++------------------- vignettes/tutorial.qmd | 2 +- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/R/tt_bootstrap.R b/R/tt_bootstrap.R index e7927831..b9fac76e 100644 --- a/R/tt_bootstrap.R +++ b/R/tt_bootstrap.R @@ -114,8 +114,9 @@ bootstrap_setting <- function(x, new, component = "row") { idx <- grep("tinytable columns before this", out) } else if (component == "cell") { idx <- grep("tinytable cells before this", out) + # idx <- 8 # hard-coded location (dangerous?) } else if (component == "css") { - idx <- grep("", out, fixed = TRUE) + idx <- grep("", out, fixed = TRUE)[1] } else if (component == "newrows") { idx <- grep("tinytable new rows before this", out) } diff --git a/inst/templates/bootstrap.html b/inst/templates/bootstrap.html index 6d98a1c5..51aafa5a 100644 --- a/inst/templates/bootstrap.html +++ b/inst/templates/bootstrap.html @@ -1,44 +1,17 @@ - $tinytable_TABLE_ID - - - - +
- +
$tinytable_BOOTSTRAP_CAPTION $tinytable_BOOTSTRAP_HEADER @@ -50,6 +23,28 @@
+ + + + + diff --git a/vignettes/tutorial.qmd b/vignettes/tutorial.qmd index 5a147ca7..12101ba8 100644 --- a/vignettes/tutorial.qmd +++ b/vignettes/tutorial.qmd @@ -83,7 +83,7 @@ tt(x, align = "ccrrl") The `width` arguments accepts a number between 0 and 1, indicating what proportion of the linewidth the table should cover: ```{r} -tt(x, width = 0.3) +tt(x, width = 0.5) ``` ```{r}