Skip to content

Commit

Permalink
fix header
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jan 20, 2024
1 parent ddec548 commit aa02ad0
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion R/style_tt.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' Note that Markdown and Word formats are limited to these styles: italic, bold, strikeout.
#'
#' @param x A table object created by `tt()`.
#' @param i Row indices where the styling should be applied. Can be a single value or a vector. If `colspan` is used, `i` must be of length 1. When i=0, the header is styled.
#' @param i Row indices where the styling should be applied. Can be a single value or a vector. `i=0` is the header, and negative values are higher level headers. If `colspan` is used, `i` must be of length 1.
#' @param j Column indices where the styling should be applied. Can be a single value, a vector, or a Perl-style regular expression applied to column names of the original data frame. If `colspan` is used, `j` must be of length 1.
#' @param bold Logical; if `TRUE`, text is styled in bold.
#' @param italic Logical; if `TRUE`, text is styled in italic.
Expand Down
2 changes: 0 additions & 2 deletions R/tt_bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ tt_bootstrap <- function(x, caption, theme, width, notes, ...) {

# table and styling function in JS must have different names when there is more than one table on a page.
template <- gsub("styleCell", paste0("styleCell_", id), template, fixed = TRUE)
template <- gsub("styleHeaderCell", paste0("styleHeaderCell_", id), template, fixed = TRUE)
template <- gsub("$tinytable_TABLE_ID", paste0("tinytable_", id), template, fixed = TRUE)
browser()

# header
idx <- grep("$tinytable_BOOTSTRAP_HEADER", template, fixed = TRUE)
Expand Down
8 changes: 0 additions & 8 deletions inst/templates/bootstrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@
var table = document.getElementById("$tinytable_TABLE_ID");
table.rows[i].cells[j].classList.add(css_id);
}
function styleHeaderCell(i, j, css_id) {
var table = document.getElementById("$tinytable_TABLE_ID");
var headerRow = table.tHead.rows[i];
var headerRow = table.querySelector("thead tr");
if (headerRow) {
headerRow.cells[j].classList.add(css_id);
}
}
function insertSpanRow(i, colspan, content) {
var table = document.getElementById('$tinytable_TABLE_ID');
var newRow = table.insertRow(i);
Expand Down
Binary file removed inst/tinytest/_tinysnapshot/html-heatmap.rds
Binary file not shown.
Binary file removed inst/tinytest/_tinysnapshot/html-issue58.rds
Binary file not shown.
Binary file removed inst/tinytest/_tinysnapshot/html-issue88.rds
Binary file not shown.
Binary file removed inst/tinytest/_tinysnapshot/html-issue92.rds
Binary file not shown.
Binary file removed inst/tinytest/_tinysnapshot/html-striped.rds
Binary file not shown.
Binary file removed inst/tinytest/_tinysnapshot/html-striped_orange.rds
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion man/group_tt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/style_bootstrap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/style_tt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aa02ad0

Please sign in to comment.