Skip to content

Commit

Permalink
0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jan 18, 2024
1 parent 1465a33 commit c4b4377
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
7 changes: 2 additions & 5 deletions R/style_bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand All @@ -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")
Expand Down

0 comments on commit c4b4377

Please sign in to comment.