Skip to content

Commit

Permalink
html template
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jan 13, 2024
1 parent 0674a8c commit 61a970e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
42 changes: 21 additions & 21 deletions inst/templates/bootstrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>$tinytable_TABLE_ID</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<style>
table {
width: auto;
margin-left: auto;
margin-right: auto;
}
</style>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>

<body>
Expand All @@ -33,23 +26,30 @@
<tbody>
$tinytable_BOOTSTRAP_BODY
</tbody>
<script>
function styleCell(i, j, css_id) {
var table = document.getElementById("$tinytable_TABLE_ID");
table.rows[i].cells[j].classList.add(css_id);
}
function insertSpanRow(i, colspan, content) {
var table = document.getElementById('$tinytable_TABLE_ID');
var newRow = table.insertRow(i);
var newCell = newRow.insertCell(0);
newCell.setAttribute("colspan", colspan);
newCell.innerText = content;
}
// tinytable cells before this
</script>
</table>
</div>

<script>
function styleCell(i, j, css_id) {
var table = document.getElementById("$tinytable_TABLE_ID");
table.rows[i].cells[j].classList.add(css_id);
}
function insertSpanRow(i, colspan, content) {
var table = document.getElementById('$tinytable_TABLE_ID');
var newRow = table.insertRow(i);
var newCell = newRow.insertCell(0);
newCell.setAttribute("colspan", colspan);
newCell.innerText = content;
}
// tinytable cells before this
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
</body>

</html>
Expand Down
2 changes: 1 addition & 1 deletion vignettes/tutorial.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ tt(x, align = "ccrrl")
The `width` arguments accepts a number between 0 and 1, indicating what proportion of the linewidth the table should cover:

```{r}
tt(x, width = 0.5)
tt(x, width = 0.3)
```

```{r}
Expand Down

0 comments on commit 61a970e

Please sign in to comment.