Skip to content

Commit b143345

Browse files
committed
[ui] table style
1 parent cec28fe commit b143345

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

server.R

+9-13
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ shinyServer(function(input, output, session) {
1717
) {
1818
m = matrix(data = c(message))
1919
return(
20-
datatable(m, options = list(scrollX = TRUE, dom = 't'), colnames = NULL) %>%
20+
datatable(m, options = list(dom = 't'), colnames = NULL) %>%
2121
formatStyle(
2222
1,
2323
color = col,
@@ -255,7 +255,7 @@ shinyServer(function(input, output, session) {
255255
#' UI depths table
256256
output$depth.table <- DT::renderDataTable(rownames = FALSE, {
257257
return(get.depths.table())
258-
}, options = list(scrollX = TRUE, dom = 't'))
258+
}, options = list(dom = 't'))
259259

260260
output$depth.table.info <- renderText({
261261
depths = get.depths.table()
@@ -442,9 +442,7 @@ shinyServer(function(input, output, session) {
442442
rawDataTable = tab.with.message(message.fail.upload)
443443
}
444444
return(rawDataTable)
445-
}, options = list(scrollX = TRUE,
446-
scrollY = "400px",
447-
dom = "t"))
445+
}, options = list(dom = "t"))
448446

449447

450448
#' UI Table with raw data, long-format
@@ -462,9 +460,7 @@ shinyServer(function(input, output, session) {
462460
tab = tab.with.message(message.fail.upload)
463461
}
464462
return(tab)
465-
}, options = list(scrollX = TRUE,
466-
scrollY = "400px",
467-
dom = "t"))
463+
}, options = list(dom = "t"))
468464

469465
#### Text output ####
470466

@@ -758,25 +754,25 @@ shinyServer(function(input, output, session) {
758754
#' (K-value > Estimation > K-value estimation > Selected)
759755
output$kSelected <- DT::renderDataTable(rownames = FALSE, {
760756
return(values$kvalues)
761-
}, options = list(scrollX = TRUE, dom = 't'))
757+
}, options = list(dom = 't'))
762758

763759
#' UI table output of auto. regression k-values
764760
#' (K-value > Estimation > K-value estimation > Regression)
765761
output$kRegression <- DT::renderDataTable(rownames = FALSE, {
766762
return(kComplete()$regression %>% mutate_if(is.numeric, round, 2))
767-
}, options = list(scrollX = TRUE, dom = 't'))
763+
}, options = list(dom = 't'))
768764

769765
#' UI table output of closest zero-flow k-values
770766
#' (K-value > Estimation > K-value estimation > Zero-flow)
771767
output$kZeroFlow <- DT::renderDataTable(rownames = FALSE, {
772768
return(kComplete()$no.flow %>% mutate_if(is.numeric, round, 2))
773-
}, options = list(scrollX = TRUE, dom = 't'))
769+
}, options = list(dom = 't'))
774770

775771
#' UI table output of uploaded k-values
776772
#' (K-value > Estimation > K-value estimation > Read csv)
777773
output$uploadedKvalues <- DT::renderDataTable(rownames = FALSE, {
778774
return(kFromCsv())
779-
}, options = list(scrollX = TRUE, dom = 't'))
775+
}, options = list(dom = 't'))
780776

781777

782778
#### Graphics ####
@@ -1197,7 +1193,7 @@ shinyServer(function(input, output, session) {
11971193
#' UI-Table with daily tree water use
11981194
output$TWUtable <- DT::renderDataTable(rownames = FALSE, {
11991195
treeWaterUse()
1200-
}, options = list(scrollX = TRUE, searching = F)) #dom = 't')
1196+
}, options = list(dom = 't'))
12011197

12021198

12031199
#' Eventlistener to save daily tree water use as csv

www/styles.css

+11
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,14 @@ body > .wrapper > header{
7474
background-color: #f5f5f5;
7575
border-radius: 4px;
7676
}
77+
/* Overwrite data table layout */
78+
.dataTables_wrapper {
79+
max-width: 100%;
80+
max-height: 350px;
81+
overflow: auto;
82+
}
83+
.dataTable thead {
84+
position: sticky;
85+
top: 0;
86+
background: #fff;
87+
}

0 commit comments

Comments
 (0)