Skip to content

Commit 2f45df1

Browse files
endsWidth delimiter fix
1 parent 62869ab commit 2f45df1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+473
-996
lines changed

R/group_tt_j.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
j_delim_to_named_list <- function(x, j) {
66
nm <- x@names
77

8+
# Preprocess column names: add space at start/end if they start/end with delimiter
9+
for (i in seq_along(nm)) {
10+
# Check if ends with delimiter
11+
# Do not check if starts with delimiter, because we sometimes want empty groups in the top header
12+
if (endsWith(nm[i], j)) {
13+
nm[i] <- paste0(nm[i], " ")
14+
}
15+
}
16+
817
# Find which columns contain the delimiter
918
indices <- grepl(j, nm, fixed = TRUE)
1019

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ tt(x,
135135

136136
## Tutorial
137137

138-
The `tinytable` 0.14.0 tutorial will take you much further. It is
138+
The `tinytable` 0.15.0.3 tutorial will take you much further. It is
139139
available in HTML and PDF formats at:
140140
<https://vincentarelbundock.github.io/tinytable/>
141141

inst/tinytest/_tinysnapshot/group-3level.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

inst/tinytest/_tinysnapshot/group-3level.tex

Lines changed: 0 additions & 38 deletions
This file was deleted.

inst/tinytest/_tinysnapshot/group-3level.typ

Lines changed: 0 additions & 91 deletions
This file was deleted.

inst/tinytest/_tinysnapshot/group-html_tutorial_01.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>tinytable_hxj2pk5gonuvakgmasgd</title>
7+
<title>tinytable_1z85sqvj7lv8g3xzoy7o</title>
88

99
</head>
1010
<body>
@@ -14,25 +14,25 @@
1414

1515
<script>
1616
// Create table-specific functions using external factory
17-
const tableFns_hxj2pk5gonuvakgmasgd = TinyTable.createTableFunctions("tinytable_hxj2pk5gonuvakgmasgd");
17+
const tableFns_1z85sqvj7lv8g3xzoy7o = TinyTable.createTableFunctions("tinytable_1z85sqvj7lv8g3xzoy7o");
1818
// tinytable span after
19-
window.addEventListener('load', function () { tableFns_hxj2pk5gonuvakgmasgd.spanCell(9, 1, 1, 5) })
20-
window.addEventListener('load', function () { tableFns_hxj2pk5gonuvakgmasgd.spanCell(3, 1, 1, 5) })
19+
window.addEventListener('load', function () { tableFns_1z85sqvj7lv8g3xzoy7o.spanCell(9, 1, 1, 5) })
20+
window.addEventListener('load', function () { tableFns_1z85sqvj7lv8g3xzoy7o.spanCell(3, 1, 1, 5) })
2121
window.addEventListener('load', function () {
2222
var cellsToStyle = [
2323
// tinytable style arrays after
24-
{ positions: [ { i: '-1', j: 5 } ], css_id: 'tinytable_css_leewe91vltwy9b5hi5mx',},
25-
{ positions: [ { i: '-1', j: 3 } ], css_id: 'tinytable_css_68f9u4i9ss3bjgrhhdme',},
26-
{ positions: [ { i: '-1', j: 2 }, { i: '-1', j: 4 } ], css_id: 'tinytable_css_st4aratt7tslm5pn68og',},
27-
{ positions: [ { i: '12', j: 1 }, { i: '12', j: 2 }, { i: '12', j: 3 }, { i: '12', j: 4 }, { i: '12', j: 5 } ], css_id: 'tinytable_css_mc5iub5xk27kyukb25ww',},
28-
{ positions: [ { i: '0', j: 1 }, { i: '0', j: 2 }, { i: '0', j: 3 }, { i: '0', j: 4 }, { i: '0', j: 5 } ], css_id: 'tinytable_css_vnazvmik2c64os468wpr',},
29-
{ positions: [ { i: '-1', j: 1 } ], css_id: 'tinytable_css_gwf47y2v636qmzys8ggv',},
24+
{ positions: [ { i: '-1', j: 5 } ], css_id: 'tinytable_css_68f9u4i9ss3bjgrhhdme',},
25+
{ positions: [ { i: '-1', j: 3 } ], css_id: 'tinytable_css_st4aratt7tslm5pn68og',},
26+
{ positions: [ { i: '-1', j: 2 }, { i: '-1', j: 4 } ], css_id: 'tinytable_css_mc5iub5xk27kyukb25ww',},
27+
{ positions: [ { i: '12', j: 1 }, { i: '12', j: 2 }, { i: '12', j: 3 }, { i: '12', j: 4 }, { i: '12', j: 5 } ], css_id: 'tinytable_css_vnazvmik2c64os468wpr',},
28+
{ positions: [ { i: '0', j: 1 }, { i: '0', j: 2 }, { i: '0', j: 3 }, { i: '0', j: 4 }, { i: '0', j: 5 } ], css_id: 'tinytable_css_gwf47y2v636qmzys8ggv',},
29+
{ positions: [ { i: '-1', j: 1 } ], css_id: 'tinytable_css_hxj2pk5gonuvakgmasgd',},
3030
];
3131

3232
// Loop over the arrays to style the cells
3333
cellsToStyle.forEach(function (group) {
3434
group.positions.forEach(function (cell) {
35-
tableFns_hxj2pk5gonuvakgmasgd.styleCell(cell.i, cell.j, group.css_id);
35+
tableFns_1z85sqvj7lv8g3xzoy7o.styleCell(cell.i, cell.j, group.css_id);
3636
});
3737
});
3838
});
@@ -41,15 +41,15 @@
4141
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/vincentarelbundock/tinytable@main/inst/tinytable.css">
4242
<style>
4343
/* tinytable css entries after */
44-
#tinytable_hxj2pk5gonuvakgmasgd td.tinytable_css_leewe91vltwy9b5hi5mx, #tinytable_hxj2pk5gonuvakgmasgd th.tinytable_css_leewe91vltwy9b5hi5mx { position: relative; --border-bottom: 1; --border-left: 0; --border-right: 0; --border-top: 1; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.05em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 0%; --trim-bottom-right: 0%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; ; text-align: center }
45-
#tinytable_hxj2pk5gonuvakgmasgd td.tinytable_css_68f9u4i9ss3bjgrhhdme, #tinytable_hxj2pk5gonuvakgmasgd th.tinytable_css_68f9u4i9ss3bjgrhhdme { position: relative; --border-bottom: 1; --border-left: 0; --border-right: 0; --border-top: 1; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.05em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 0%; --trim-bottom-right: 3%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; ; text-align: center }
46-
#tinytable_hxj2pk5gonuvakgmasgd td.tinytable_css_st4aratt7tslm5pn68og, #tinytable_hxj2pk5gonuvakgmasgd th.tinytable_css_st4aratt7tslm5pn68og { position: relative; --border-bottom: 1; --border-left: 0; --border-right: 0; --border-top: 1; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.05em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 3%; --trim-bottom-right: 0%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; ; text-align: center }
47-
#tinytable_hxj2pk5gonuvakgmasgd td.tinytable_css_mc5iub5xk27kyukb25ww, #tinytable_hxj2pk5gonuvakgmasgd th.tinytable_css_mc5iub5xk27kyukb25ww { position: relative; --border-bottom: 1; --border-left: 0; --border-right: 0; --border-top: 0; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.1em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 0%; --trim-bottom-right: 0%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; }
48-
#tinytable_hxj2pk5gonuvakgmasgd td.tinytable_css_vnazvmik2c64os468wpr, #tinytable_hxj2pk5gonuvakgmasgd th.tinytable_css_vnazvmik2c64os468wpr { position: relative; --border-bottom: 1; --border-left: 0; --border-right: 0; --border-top: 0; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.05em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 0%; --trim-bottom-right: 0%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; }
49-
#tinytable_hxj2pk5gonuvakgmasgd td.tinytable_css_gwf47y2v636qmzys8ggv, #tinytable_hxj2pk5gonuvakgmasgd th.tinytable_css_gwf47y2v636qmzys8ggv { position: relative; --border-bottom: 0; --border-left: 0; --border-right: 0; --border-top: 1; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.1em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 0%; --trim-bottom-right: 0%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; ; text-align: center }
44+
#tinytable_1z85sqvj7lv8g3xzoy7o td.tinytable_css_68f9u4i9ss3bjgrhhdme, #tinytable_1z85sqvj7lv8g3xzoy7o th.tinytable_css_68f9u4i9ss3bjgrhhdme { position: relative; --border-bottom: 1; --border-left: 0; --border-right: 0; --border-top: 1; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.05em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 0%; --trim-bottom-right: 0%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; ; text-align: center }
45+
#tinytable_1z85sqvj7lv8g3xzoy7o td.tinytable_css_st4aratt7tslm5pn68og, #tinytable_1z85sqvj7lv8g3xzoy7o th.tinytable_css_st4aratt7tslm5pn68og { position: relative; --border-bottom: 1; --border-left: 0; --border-right: 0; --border-top: 1; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.05em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 0%; --trim-bottom-right: 3%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; ; text-align: center }
46+
#tinytable_1z85sqvj7lv8g3xzoy7o td.tinytable_css_mc5iub5xk27kyukb25ww, #tinytable_1z85sqvj7lv8g3xzoy7o th.tinytable_css_mc5iub5xk27kyukb25ww { position: relative; --border-bottom: 1; --border-left: 0; --border-right: 0; --border-top: 1; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.05em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 3%; --trim-bottom-right: 0%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; ; text-align: center }
47+
#tinytable_1z85sqvj7lv8g3xzoy7o td.tinytable_css_vnazvmik2c64os468wpr, #tinytable_1z85sqvj7lv8g3xzoy7o th.tinytable_css_vnazvmik2c64os468wpr { position: relative; --border-bottom: 1; --border-left: 0; --border-right: 0; --border-top: 0; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.1em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 0%; --trim-bottom-right: 0%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; }
48+
#tinytable_1z85sqvj7lv8g3xzoy7o td.tinytable_css_gwf47y2v636qmzys8ggv, #tinytable_1z85sqvj7lv8g3xzoy7o th.tinytable_css_gwf47y2v636qmzys8ggv { position: relative; --border-bottom: 1; --border-left: 0; --border-right: 0; --border-top: 0; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.05em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 0%; --trim-bottom-right: 0%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; }
49+
#tinytable_1z85sqvj7lv8g3xzoy7o td.tinytable_css_hxj2pk5gonuvakgmasgd, #tinytable_1z85sqvj7lv8g3xzoy7o th.tinytable_css_hxj2pk5gonuvakgmasgd { position: relative; --border-bottom: 0; --border-left: 0; --border-right: 0; --border-top: 1; --line-color-bottom: black; --line-color-left: black; --line-color-right: black; --line-color-top: black; --line-width-bottom: 0.1em; --line-width-left: 0.1em; --line-width-right: 0.1em; --line-width-top: 0.1em; --trim-bottom-left: 0%; --trim-bottom-right: 0%; --trim-left-bottom: 0%; --trim-left-top: 0%; --trim-right-bottom: 0%; --trim-right-top: 0%; --trim-top-left: 0%; --trim-top-right: 0%; ; text-align: center }
5050
</style>
5151
<div class="container">
52-
<table class="tinytable" id="tinytable_hxj2pk5gonuvakgmasgd" style="width: auto; margin-left: auto; margin-right: auto;" data-quarto-disable-processing='true'>
52+
<table class="tinytable" id="tinytable_1z85sqvj7lv8g3xzoy7o" style="width: auto; margin-left: auto; margin-right: auto;" data-quarto-disable-processing='true'>
5353

5454
<thead>
5555
<tr>

0 commit comments

Comments
 (0)