library(DT, quietly = TRUE)
library(knitr, quietly = TRUE)

knitr::opts_chunk$set(echo = FALSE)

source("config.R")
cat(paste0("# ", gsub("(.*)[\\.].*", "\\1", basename(paths[1]))))
x <- read.csv(paths[1])
colnames(x) <- gsub("\\."," ", colnames(x))
DT::datatable(x, rownames = FALSE, options = list(
        columnDefs = list(list(className = 'dt-center', targets = 1:6)),
        lengthMenu = list(c(10, 25, 50, -1), c('10', '25', '50', 'All')),
        pageLength = -1,
        initComplete = DT::JS(
            "function(settings, json) {",
            "$(this.api().table().header()).css( {",
            " 'background-color': '#216734',", # javascript for DT style
            " 'color': '#fff'",
            "});",
            "}"), searchHighlight = TRUE),
    escape = 1, filter = "bottom")


ncss-tech/soilReports documentation built on April 25, 2024, 1:03 a.m.