From c4b4377b92835c39d3665746e64e233f7db1c005 Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Wed, 17 Jan 2024 23:00:12 -0500 Subject: [PATCH] 0.0.1 --- DESCRIPTION | 6 +++--- R/style_bootstrap.R | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9e82dfec..7a23c12a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: tinytable Type: Package -Title: Simple and Customizable Tables in 'HTML', 'LaTeX', 'Markdown', and 'Typst' -Description: Create highly customized tables with this simple and dependency-free package. Data frames can be converted to 'HTML', 'LaTeX', 'Markdown', or 'Typst' tables. The user interface is minimalist and the syntax concise. 'HTML' tables can be customized using the flexible 'Bootstrap' framework, and 'LaTeX' code with the 'tabularray' package. -Version: 0.0.0 +Title: Simple and Customizable Tables in 'HTML', 'LaTeX', and 'Markdown'. +Description: Create highly customized tables with this simple and dependency-free package. Data frames can be converted to 'HTML', 'LaTeX', or 'Markdown' tables. The user interface is minimalist and the syntax concise. 'HTML' tables can be customized using the flexible 'Bootstrap' framework, and 'LaTeX' code with the 'tabularray' package. +Version: 0.0.1 Depends: R (>= 4.0.0) Enhances: diff --git a/R/style_bootstrap.R b/R/style_bootstrap.R index cbc1940b..b054b22f 100644 --- a/R/style_bootstrap.R +++ b/R/style_bootstrap.R @@ -88,10 +88,6 @@ style_bootstrap <- function(x, id <- sapply(unique(settings$bootstrap), function(k) get_id(stem = "tinytable_css_")) settings$id <- id[match(settings$bootstrap, names(id))] - css_start <- sprintf(".table td.%s, th.%s { ", id, id) - css_complete <- paste(c(css_start, paste0(bootstrap_css, collapse="; "), "}"), collapse = " ") - out <- bootstrap_setting(out, css_complete, component = "css") - # CSS style for cell css_done <- NULL for (row in seq_len(nrow(settings))) { @@ -101,8 +97,9 @@ style_bootstrap <- function(x, out <- bootstrap_setting(out, listener, component = "cell") # CSS styling + css <- paste(bootstrap_css, settings$bootstrap[row], collapse = ";") css_start <- sprintf(".table td.%s, th.%s { ", settings$id[row], settings$id[row]) - css_complete <- paste(c(css_start, paste0(settings$bootstrap[row], collapse="; "), "}"), collapse = " ") + css_complete <- paste(c(css_start, css, "}"), collapse = " ") # hack: avoid css duplication if (!css_complete %in% css_done) { out <- bootstrap_setting(out, css_complete, component = "css")