diff --git a/man/tt.html b/man/tt.html
index 2b329b49..50153c60 100644
--- a/man/tt.html
+++ b/man/tt.html
@@ -393,7 +393,7 @@
Examples
- tinytable_v7mlkvttebyjo8zkcjqp
+ tinytable_swyknqiofs7y1tgs1os1
@@ -413,7 +413,7 @@ Examples
-
+
@@ -460,12 +460,12 @@ Examples
@@ -535,7 +535,7 @@ Examples
-
+
Data about cars.
@@ -582,42 +582,42 @@ Examples
diff --git a/search.json b/search.json
index 8d01d2bf..547b4014 100644
--- a/search.json
+++ b/search.json
@@ -144,14 +144,14 @@
"href": "man/tt.html",
"title": "tinytable",
"section": "",
- "text": "The tt function renders a table in different formats (HTML, Markdown, or LaTeX) with various styling options.\n\n\n\ntt(\n x,\n output = NULL,\n align = NULL,\n caption = NULL,\n width = NULL,\n notes = NULL,\n theme = \"default\",\n placement = getOption(\"tt_tabularray_placement\", default = NULL)\n)\n\n\n\n\n\n\n\n\nx\n\n\nA data frame or data table to be rendered as a table.\n\n\n\n\noutput\n\n\nThe format of the output table. Can be \"html\", \"latex\", or \"markdown\". If NULL, the format is automatically detected in Quarto or Rmarkdown documents.\n\n\n\n\nalign\n\n\nA string specifying the alignment of columns. Each character in the string corresponds to a column; ‘l’ for left, ‘c’ for center, and ‘r’ for right alignment. The length of the string must match the number of columns in x.\n\n\n\n\ncaption\n\n\nA string that will be used as the caption of the table.\n\n\n\n\nwidth\n\n\nA numeric value between 0 and 1 indicating the proportion of the line width that the table should cover.\n\n\n\n\nnotes\n\n\nA single string or a (named) list of strings to append at the bottom of the table.\n\n\n\n\ntheme\n\n\nThe theme to apply to the table.\n\n\nLaTeX: \"default\", \"striped\", \"void\", or \"grid\".\n\n\nHTML: \"default\", \"striped\", \"void\", \"grid\", or a (composite) Bootstrap class such as “table table-dark” or “table table-dark table-hover”. See\n\n\n\n\n\n\nplacement\n\n\nA string to control the position of tables in LaTeX. Will be inserted in square brackets like: \\begin{table}[H]\n\n\n\n\n\n\n\nAn object of class tt representing the table.\n\n\n\nWhen rendering Quarto and Rmarkdown documents, tinytable will populate the LaTeX preamble automatically with all the required packages. For standalone LaTeX packages, these commands should be inserted in the preamble:\n\n\n\\usepackage{tabularray}\n\\usepackage{float}\n\\usepackage{codehigh}\n\\usepackage[normalem]{ulem}\n\\UseTblrLibrary{booktabs}\n\\newcommand{\\tinytableTabularrayUnderline}[1]{\\underline{#1}}\",\n\\newcommand{\\tinytableTabularrayStrikeout}[1]{\\sout{#1}}\",\n\\NewTableCommand{\\tinytableDefineColor}[3]{\\definecolor{#1}{#2}{#3}}\n\n\n\n\n\n\nlibrary(tinytable)\n\n\n\nlibrary(tinytable)\nx <- mtcars[1:4, 1:5]\n\ntt(x)\n\n\n \n\n \n \n \n tinytable_v7mlkvttebyjo8zkcjqp\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\ntt(x,\n theme = \"striped\",\n width = 0.5,\n align = \"ccrrl\",\n caption = \"Data about cars.\")\n\n\n \n\n \n \n \n tinytable_qpguw3o4te9hucrat4eb\n \n \n \n \n \n \n\n \n \n \n \n Data about cars.\n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "The tt function renders a table in different formats (HTML, Markdown, or LaTeX) with various styling options.\n\n\n\ntt(\n x,\n output = NULL,\n align = NULL,\n caption = NULL,\n width = NULL,\n notes = NULL,\n theme = \"default\",\n placement = getOption(\"tt_tabularray_placement\", default = NULL)\n)\n\n\n\n\n\n\n\n\nx\n\n\nA data frame or data table to be rendered as a table.\n\n\n\n\noutput\n\n\nThe format of the output table. Can be \"html\", \"latex\", or \"markdown\". If NULL, the format is automatically detected in Quarto or Rmarkdown documents.\n\n\n\n\nalign\n\n\nA string specifying the alignment of columns. Each character in the string corresponds to a column; ‘l’ for left, ‘c’ for center, and ‘r’ for right alignment. The length of the string must match the number of columns in x.\n\n\n\n\ncaption\n\n\nA string that will be used as the caption of the table.\n\n\n\n\nwidth\n\n\nA numeric value between 0 and 1 indicating the proportion of the line width that the table should cover.\n\n\n\n\nnotes\n\n\nA single string or a (named) list of strings to append at the bottom of the table.\n\n\n\n\ntheme\n\n\nThe theme to apply to the table.\n\n\nLaTeX: \"default\", \"striped\", \"void\", or \"grid\".\n\n\nHTML: \"default\", \"striped\", \"void\", \"grid\", or a (composite) Bootstrap class such as “table table-dark” or “table table-dark table-hover”. See\n\n\n\n\n\n\nplacement\n\n\nA string to control the position of tables in LaTeX. Will be inserted in square brackets like: \\begin{table}[H]\n\n\n\n\n\n\n\nAn object of class tt representing the table.\n\n\n\nWhen rendering Quarto and Rmarkdown documents, tinytable will populate the LaTeX preamble automatically with all the required packages. For standalone LaTeX packages, these commands should be inserted in the preamble:\n\n\n\\usepackage{tabularray}\n\\usepackage{float}\n\\usepackage{codehigh}\n\\usepackage[normalem]{ulem}\n\\UseTblrLibrary{booktabs}\n\\newcommand{\\tinytableTabularrayUnderline}[1]{\\underline{#1}}\",\n\\newcommand{\\tinytableTabularrayStrikeout}[1]{\\sout{#1}}\",\n\\NewTableCommand{\\tinytableDefineColor}[3]{\\definecolor{#1}{#2}{#3}}\n\n\n\n\n\n\nlibrary(tinytable)\n\n\n\nlibrary(tinytable)\nx <- mtcars[1:4, 1:5]\n\ntt(x)\n\n\n \n\n \n \n \n tinytable_swyknqiofs7y1tgs1os1\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\ntt(x,\n theme = \"striped\",\n width = 0.5,\n align = \"ccrrl\",\n caption = \"Data about cars.\")\n\n\n \n\n \n \n \n tinytable_25uelg65qfz8y2bep5gy\n \n \n \n \n \n \n\n \n \n \n \n Data about cars.\n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "man/tt.html#draw-a-tiny-table",
"href": "man/tt.html#draw-a-tiny-table",
"title": "tinytable",
"section": "",
- "text": "The tt function renders a table in different formats (HTML, Markdown, or LaTeX) with various styling options.\n\n\n\ntt(\n x,\n output = NULL,\n align = NULL,\n caption = NULL,\n width = NULL,\n notes = NULL,\n theme = \"default\",\n placement = getOption(\"tt_tabularray_placement\", default = NULL)\n)\n\n\n\n\n\n\n\n\nx\n\n\nA data frame or data table to be rendered as a table.\n\n\n\n\noutput\n\n\nThe format of the output table. Can be \"html\", \"latex\", or \"markdown\". If NULL, the format is automatically detected in Quarto or Rmarkdown documents.\n\n\n\n\nalign\n\n\nA string specifying the alignment of columns. Each character in the string corresponds to a column; ‘l’ for left, ‘c’ for center, and ‘r’ for right alignment. The length of the string must match the number of columns in x.\n\n\n\n\ncaption\n\n\nA string that will be used as the caption of the table.\n\n\n\n\nwidth\n\n\nA numeric value between 0 and 1 indicating the proportion of the line width that the table should cover.\n\n\n\n\nnotes\n\n\nA single string or a (named) list of strings to append at the bottom of the table.\n\n\n\n\ntheme\n\n\nThe theme to apply to the table.\n\n\nLaTeX: \"default\", \"striped\", \"void\", or \"grid\".\n\n\nHTML: \"default\", \"striped\", \"void\", \"grid\", or a (composite) Bootstrap class such as “table table-dark” or “table table-dark table-hover”. See\n\n\n\n\n\n\nplacement\n\n\nA string to control the position of tables in LaTeX. Will be inserted in square brackets like: \\begin{table}[H]\n\n\n\n\n\n\n\nAn object of class tt representing the table.\n\n\n\nWhen rendering Quarto and Rmarkdown documents, tinytable will populate the LaTeX preamble automatically with all the required packages. For standalone LaTeX packages, these commands should be inserted in the preamble:\n\n\n\\usepackage{tabularray}\n\\usepackage{float}\n\\usepackage{codehigh}\n\\usepackage[normalem]{ulem}\n\\UseTblrLibrary{booktabs}\n\\newcommand{\\tinytableTabularrayUnderline}[1]{\\underline{#1}}\",\n\\newcommand{\\tinytableTabularrayStrikeout}[1]{\\sout{#1}}\",\n\\NewTableCommand{\\tinytableDefineColor}[3]{\\definecolor{#1}{#2}{#3}}\n\n\n\n\n\n\nlibrary(tinytable)\n\n\n\nlibrary(tinytable)\nx <- mtcars[1:4, 1:5]\n\ntt(x)\n\n\n \n\n \n \n \n tinytable_v7mlkvttebyjo8zkcjqp\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\ntt(x,\n theme = \"striped\",\n width = 0.5,\n align = \"ccrrl\",\n caption = \"Data about cars.\")\n\n\n \n\n \n \n \n tinytable_qpguw3o4te9hucrat4eb\n \n \n \n \n \n \n\n \n \n \n \n Data about cars.\n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "The tt function renders a table in different formats (HTML, Markdown, or LaTeX) with various styling options.\n\n\n\ntt(\n x,\n output = NULL,\n align = NULL,\n caption = NULL,\n width = NULL,\n notes = NULL,\n theme = \"default\",\n placement = getOption(\"tt_tabularray_placement\", default = NULL)\n)\n\n\n\n\n\n\n\n\nx\n\n\nA data frame or data table to be rendered as a table.\n\n\n\n\noutput\n\n\nThe format of the output table. Can be \"html\", \"latex\", or \"markdown\". If NULL, the format is automatically detected in Quarto or Rmarkdown documents.\n\n\n\n\nalign\n\n\nA string specifying the alignment of columns. Each character in the string corresponds to a column; ‘l’ for left, ‘c’ for center, and ‘r’ for right alignment. The length of the string must match the number of columns in x.\n\n\n\n\ncaption\n\n\nA string that will be used as the caption of the table.\n\n\n\n\nwidth\n\n\nA numeric value between 0 and 1 indicating the proportion of the line width that the table should cover.\n\n\n\n\nnotes\n\n\nA single string or a (named) list of strings to append at the bottom of the table.\n\n\n\n\ntheme\n\n\nThe theme to apply to the table.\n\n\nLaTeX: \"default\", \"striped\", \"void\", or \"grid\".\n\n\nHTML: \"default\", \"striped\", \"void\", \"grid\", or a (composite) Bootstrap class such as “table table-dark” or “table table-dark table-hover”. See\n\n\n\n\n\n\nplacement\n\n\nA string to control the position of tables in LaTeX. Will be inserted in square brackets like: \\begin{table}[H]\n\n\n\n\n\n\n\nAn object of class tt representing the table.\n\n\n\nWhen rendering Quarto and Rmarkdown documents, tinytable will populate the LaTeX preamble automatically with all the required packages. For standalone LaTeX packages, these commands should be inserted in the preamble:\n\n\n\\usepackage{tabularray}\n\\usepackage{float}\n\\usepackage{codehigh}\n\\usepackage[normalem]{ulem}\n\\UseTblrLibrary{booktabs}\n\\newcommand{\\tinytableTabularrayUnderline}[1]{\\underline{#1}}\",\n\\newcommand{\\tinytableTabularrayStrikeout}[1]{\\sout{#1}}\",\n\\NewTableCommand{\\tinytableDefineColor}[3]{\\definecolor{#1}{#2}{#3}}\n\n\n\n\n\n\nlibrary(tinytable)\n\n\n\nlibrary(tinytable)\nx <- mtcars[1:4, 1:5]\n\ntt(x)\n\n\n \n\n \n \n \n tinytable_swyknqiofs7y1tgs1os1\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\ntt(x,\n theme = \"striped\",\n width = 0.5,\n align = \"ccrrl\",\n caption = \"Data about cars.\")\n\n\n \n\n \n \n \n tinytable_25uelg65qfz8y2bep5gy\n \n \n \n \n \n \n\n \n \n \n \n Data about cars.\n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "CITATION.html",
@@ -179,126 +179,126 @@
"href": "vignettes/tutorial.html#themes",
"title": "tinytable",
"section": "Themes",
- "text": "Themes\ntinytable offers a few basic themes out of the box: “default”, “striped”, “grid”, “void.” Those themes can be applied with the theme argument of the tt() function. As we will see below, it is easy to go much beyond those basic settings to customize your own tables. Here we only illustrate a few of the simplest settings:\n\ntt(x, theme = \"striped\")\n\n\n \n\n \n \n \n tinytable_cnavzsakf5wb9pcfnldy\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\n\n\ntt(x, theme = \"grid\")\n\n\n \n\n \n \n \n tinytable_0cesa3cnm4n73a36goxg\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "Themes\ntinytable offers a few basic themes out of the box: “default”, “striped”, “grid”, “void.” Those themes can be applied with the theme argument of the tt() function. As we will see below, it is easy to go much beyond those basic settings to customize your own tables. Here we only illustrate a few of the simplest settings:\n\ntt(x, theme = \"striped\")\n\n\n \n\n \n \n \n tinytable_kzegbv5o4zh10dgn29ul\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\n\n\ntt(x, theme = \"grid\")\n\n\n \n\n \n \n \n tinytable_apadyexgru6gxg4zb1cz\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "vignettes/tutorial.html#alignment",
"href": "vignettes/tutorial.html#alignment",
"title": "tinytable",
"section": "Alignment",
- "text": "Alignment\nTo align columns, we use a single string, where each letter represents a column:\n\ntt(x, align = \"ccrrl\")\n\n\n \n\n \n \n \n tinytable_vvsoscez58tdbtbv9nwc\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "Alignment\nTo align columns, we use a single string, where each letter represents a column:\n\ntt(x, align = \"ccrrl\")\n\n\n \n\n \n \n \n tinytable_539o2u7y9h7kp574s4vq\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "vignettes/tutorial.html#width",
"href": "vignettes/tutorial.html#width",
"title": "tinytable",
"section": "Width",
- "text": "Width\nThe width arguments accepts a number between 0 and 1, indicating what proportion of the linewidth the table should cover:\n\ntt(x, width = 0.5)\n\n\n \n\n \n \n \n tinytable_enh5fdh3vzdzhg5933a6\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\n\n\ntt(x, width = 1)\n\n\n \n\n \n \n \n tinytable_qbebzwh13kgbufx0qgmb\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "Width\nThe width arguments accepts a number between 0 and 1, indicating what proportion of the linewidth the table should cover:\n\ntt(x, width = 0.5)\n\n\n \n\n \n \n \n tinytable_p0083bvr9m05h95imzjk\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\n\n\ntt(x, width = 1)\n\n\n \n\n \n \n \n tinytable_ja6r9pv8ax35icei4fpc\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "vignettes/tutorial.html#line-breaks-and-text-wrapping",
"href": "vignettes/tutorial.html#line-breaks-and-text-wrapping",
"title": "tinytable",
"section": "Line breaks and text wrapping",
- "text": "Line breaks and text wrapping\nWhen the width argument is specified and a cell includes long text, the text is automatically wrapped to match the table.\n\nlorem <- data.frame(\n Lorem = \"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\",\n Ipsum = \" Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos.\"\n)\ntt(lorem, width = 3/4)\n\n\n \n\n \n \n \n tinytable_ptq6egc5f1pqk0f3tpad\n \n \n \n \n \n \n\n \n \n A full width table with wrapped text.\n \n \n \n Lorem\n Ipsum\n \n \n \n \n \n Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\n Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos.\n \n \n \n \n\n \n \n\n \n\n\n\n\n\nManual line breaks work sligthly different in LaTeX (PDF) or HTML. This table shows the two strategies. For HTML, we insert a <br> tag. For LaTeX, we wrap the string in curly braces {}, and then insert two (escaped) backslashes: \\\\\\\\\n\nd <- data.frame(\n \"{Sed ut \\\\\\\\ perspiciatis unde}\",\n \"dicta sunt<br> explicabo. Nemo\"\n) |> setNames(c(\"LaTeX line break\", \"HTML line break\"))\ntt(d, width = 1)\n\n\n \n\n \n \n \n tinytable_bmdk5krq5ml8xzzsgbbp\n \n \n \n \n \n \n\n \n \n \n \n \n \n LaTeX line break\n HTML line break\n \n \n \n \n \n {Sed ut \\\\ perspiciatis unde}\n dicta sunt explicabo. Nemo"
+ "text": "Line breaks and text wrapping\nWhen the width argument is specified and a cell includes long text, the text is automatically wrapped to match the table.\n\nlorem <- data.frame(\n Lorem = \"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\",\n Ipsum = \" Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos.\"\n)\ntt(lorem, width = 3/4)\n\n\n \n\n \n \n \n tinytable_oqeqm8vmwyldwjctx6vj\n \n \n \n \n \n \n\n \n \n A full width table with wrapped text.\n \n \n \n Lorem\n Ipsum\n \n \n \n \n \n Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\n Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos.\n \n \n \n \n\n \n \n\n \n\n\n\n\n\nManual line breaks work sligthly different in LaTeX (PDF) or HTML. This table shows the two strategies. For HTML, we insert a <br> tag. For LaTeX, we wrap the string in curly braces {}, and then insert two (escaped) backslashes: \\\\\\\\\n\nd <- data.frame(\n \"{Sed ut \\\\\\\\ perspiciatis unde}\",\n \"dicta sunt<br> explicabo. Nemo\"\n) |> setNames(c(\"LaTeX line break\", \"HTML line break\"))\ntt(d, width = 1)\n\n\n \n\n \n \n \n tinytable_2ripcw2nf9k1b0zxqk3h\n \n \n \n \n \n \n\n \n \n \n \n \n \n LaTeX line break\n HTML line break\n \n \n \n \n \n {Sed ut \\\\ perspiciatis unde}\n dicta sunt explicabo. Nemo"
},
{
"objectID": "vignettes/tutorial.html#captions-and-cross-references",
"href": "vignettes/tutorial.html#captions-and-cross-references",
"title": "tinytable",
"section": "Captions and cross-references",
- "text": "Captions and cross-references\nIn Quarto, one can specify captions and use cross-references using code like this:\n@tbl-blah shows that...\n\n```{r}\n#| label: tbl-blah\n#| tbl-cap: \"Blah blah blah\"\nlibrary(tinytable)\ntt(mtcars[1:4, 1:4])\n```\nAnd here is the rendered version of the code chunk above:\nTable 1 shows that…\n\nlibrary(tinytable)\ntt(mtcars[1:4, 1:4], placement = NULL)\n\n\n\n \n\n \n \n \n tinytable_tg2swt0ab26h4uy1lb6t\n \n \n \n \n \n \n\n \n \n Table 1: Blah blah blah \n \n \n \n mpg\n cyl\n disp\n hp\n \n \n \n \n \n 21\n 6\n 160\n 110\n \n \n 21\n 6\n 160\n 110\n \n \n 22.8\n 4\n 108\n 93\n \n \n 21.4\n 6\n 258\n 110\n \n \n \n \n\n \n \n\n \n\n\n\n\n\n\nFor standalone LaTeX tables, you can use the caption argument like so:\n\ntt(x, caption = \"Blah blah.\\\\label{tbl-blah}\")\n\nBe aware that this more approach may not work well in Quarto or Rmarkdown documents."
+ "text": "Captions and cross-references\nIn Quarto, one can specify captions and use cross-references using code like this:\n@tbl-blah shows that...\n\n```{r}\n#| label: tbl-blah\n#| tbl-cap: \"Blah blah blah\"\nlibrary(tinytable)\ntt(mtcars[1:4, 1:4])\n```\nAnd here is the rendered version of the code chunk above:\nTable 1 shows that…\n\nlibrary(tinytable)\ntt(mtcars[1:4, 1:4], placement = NULL)\n\n\n\n \n\n \n \n \n tinytable_d8nvmbh7jj5wzyg6ht9m\n \n \n \n \n \n \n\n \n \n Table 1: Blah blah blah \n \n \n \n mpg\n cyl\n disp\n hp\n \n \n \n \n \n 21\n 6\n 160\n 110\n \n \n 21\n 6\n 160\n 110\n \n \n 22.8\n 4\n 108\n 93\n \n \n 21.4\n 6\n 258\n 110\n \n \n \n \n\n \n \n\n \n\n\n\n\n\n\nFor standalone LaTeX tables, you can use the caption argument like so:\n\ntt(x, caption = \"Blah blah.\\\\label{tbl-blah}\")\n\nBe aware that this more approach may not work well in Quarto or Rmarkdown documents."
},
{
"objectID": "vignettes/tutorial.html#footnotes",
"href": "vignettes/tutorial.html#footnotes",
"title": "tinytable",
"section": "Footnotes",
- "text": "Footnotes\nThe notes argument accepts single strings or named lists of strings:\n\nn <- \"Fusce id ipsum consequat ante pellentesque iaculis eu a ipsum. Mauris id ex in nulla consectetur aliquam. In nec tempus diam. Aliquam arcu nibh, dapibus id ex vestibulum, feugiat consequat erat. Morbi feugiat dapibus malesuada. Quisque vel ullamcorper felis. Aenean a sem at nisi tempor pretium sit amet quis lacus.\"\n\ntt(lorem, notes = n, width = 1)\n\n\n \n\n \n \n \n tinytable_k0jiiq9dmxms8eirs54q\n \n \n \n \n \n \n\n \n \n A full-width table with wrapped text in cells and a footnote.\n \n \n \n Lorem\n Ipsum\n \n \n Fusce id ipsum consequat ante pellentesque iaculis eu a ipsum. Mauris id ex in nulla consectetur aliquam. In nec tempus diam. Aliquam arcu nibh, dapibus id ex vestibulum, feugiat consequat erat. Morbi feugiat dapibus malesuada. Quisque vel ullamcorper felis. Aenean a sem at nisi tempor pretium sit amet quis lacus.\n \n \n Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\n Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos.\n \n \n \n \n\n \n \n\n \n\n\n\n\n\nWhen notes is a named list, the names are used as identifiers and displayed as superscripts:\n\ntt(x, notes = list(a = \"Blah.\", b = \"Blah blah.\"))\n\n\n \n\n \n \n \n tinytable_1jsbky95gc033l3m68z9\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n a Blah.\nb Blah blah.\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "Footnotes\nThe notes argument accepts single strings or named lists of strings:\n\nn <- \"Fusce id ipsum consequat ante pellentesque iaculis eu a ipsum. Mauris id ex in nulla consectetur aliquam. In nec tempus diam. Aliquam arcu nibh, dapibus id ex vestibulum, feugiat consequat erat. Morbi feugiat dapibus malesuada. Quisque vel ullamcorper felis. Aenean a sem at nisi tempor pretium sit amet quis lacus.\"\n\ntt(lorem, notes = n, width = 1)\n\n\n \n\n \n \n \n tinytable_1qdrco12wwhp2d4r3pc2\n \n \n \n \n \n \n\n \n \n A full-width table with wrapped text in cells and a footnote.\n \n \n \n Lorem\n Ipsum\n \n \n Fusce id ipsum consequat ante pellentesque iaculis eu a ipsum. Mauris id ex in nulla consectetur aliquam. In nec tempus diam. Aliquam arcu nibh, dapibus id ex vestibulum, feugiat consequat erat. Morbi feugiat dapibus malesuada. Quisque vel ullamcorper felis. Aenean a sem at nisi tempor pretium sit amet quis lacus.\n \n \n Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\n Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos.\n \n \n \n \n\n \n \n\n \n\n\n\n\n\nWhen notes is a named list, the names are used as identifiers and displayed as superscripts:\n\ntt(x, notes = list(a = \"Blah.\", b = \"Blah blah.\"))\n\n\n \n\n \n \n \n tinytable_12bc1q0lxxpf9f5zut9e\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n a Blah.\nb Blah blah.\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "vignettes/tutorial.html#math",
"href": "vignettes/tutorial.html#math",
"title": "tinytable",
"section": "Math",
- "text": "Math\nIn LaTeX and MathJax (for HTML), there are two main ways to enclose mathematical expressions, either between dollar signs or escaped parentheses: $...$ or \\(...\\). The first strategy is discouraged by MathJax, because dollar signs are very common in non-mathematical contexts, which can cause rendering errors. In that spirit, tinytable will not render dollar-enclosed strings as mathematical expressions in HTML. Following the default MathJax settings, tinytable expects users to employ the escaped parentheses strategy:\n\ndat <- data.frame(Math = c(\"\\\\( x^2 + y^2 = z^2 \\\\)\", \"\\\\( \\\\frac{1}{2} \\\\)\"))\ntt(dat, align = \"c\")\n\n\n \n\n \n \n \n tinytable_5r34xi1itk6mzz0uuspx\n \n \n \n \n \n \n\n \n \n \n \n \n \n Math\n \n \n \n \n \n \\( x^2 + y^2 = z^2 \\)\n \n \n \\( \\frac{1}{2} \\)"
+ "text": "Math\nIn LaTeX and MathJax (for HTML), there are two main ways to enclose mathematical expressions, either between dollar signs or escaped parentheses: $...$ or \\(...\\). The first strategy is discouraged by MathJax, because dollar signs are very common in non-mathematical contexts, which can cause rendering errors. In that spirit, tinytable will not render dollar-enclosed strings as mathematical expressions in HTML. Following the default MathJax settings, tinytable expects users to employ the escaped parentheses strategy:\n\ndat <- data.frame(Math = c(\"\\\\( x^2 + y^2 = z^2 \\\\)\", \"\\\\( \\\\frac{1}{2} \\\\)\"))\ntt(dat, align = \"c\")\n\n\n \n\n \n \n \n tinytable_rzyxbzkkdyuhdlrm68mc\n \n \n \n \n \n \n\n \n \n \n \n \n \n Math\n \n \n \n \n \n \\( x^2 + y^2 = z^2 \\)\n \n \n \\( \\frac{1}{2} \\)"
},
{
"objectID": "vignettes/tutorial.html#cells-rows-columns",
"href": "vignettes/tutorial.html#cells-rows-columns",
"title": "tinytable",
"section": "Cells, rows, columns",
- "text": "Cells, rows, columns\nTo style individual cells, we use the style_cell() function. The first two arguments—i and j—identify the cells of interest, by row and column numbers respectively. To style a cell in the 2nd row and 3rd column, we can do:\n\ntt(x) |>\n style_tt(\n i = 2,\n j = 3,\n background = \"black\",\n color = \"white\")\n\n\n \n\n \n \n \n tinytable_x3n2l75l4ooq4096xqqn\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nThe i and j accept vectors of integers to modify several cells at once:\n\ntt(x) |>\n style_tt(\n i = 2:3,\n j = c(1, 3, 4),\n italic = TRUE,\n color = \"orange\")\n\n\n \n\n \n \n \n tinytable_nlmvc0rsgyse936a2wsj\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nWe can style all cells in a table by omitting both the i and j arguments:\n\ntt(x) |> style_tt(color = \"orange\")\n\n\n \n\n \n \n \n tinytable_2lq3lyn87qelfza1um0e\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nWe can style entire rows by omitting the j argument:\n\ntt(x) |> style_tt(i = 1:2, color = \"orange\")\n\n\n \n\n \n \n \n tinytable_26v60diyjfit17pondfh\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nWe can style entire columns by omitting the i argument:\n\ntt(x) |> style_tt(j = c(2, 4), bold = TRUE)\n\n\n \n\n \n \n \n tinytable_3c1oh4l9jkybnrxefm66\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nThe j argument accepts integer vectors, but also a string with a Perl-style regular expression, which makes it easier to select columns by name:\n\ntt(x) |> style_tt(j = \"mpg|drat\", color = \"orange\")\n\n\n \n\n \n \n \n tinytable_64kwh7hxb4wq7lheh5jd\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nOf course, we can also call the style_tt() function several times to apply different styles to different parts of the table:\n\ntt(x) |> \n style_tt(i = 1, j = 1:2, color = \"orange\") |>\n style_tt(i = 1, j = 3:4, color = \"green\")\n\n\n \n\n \n \n \n tinytable_s740kko67yh647lzemmc\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "Cells, rows, columns\nTo style individual cells, we use the style_cell() function. The first two arguments—i and j—identify the cells of interest, by row and column numbers respectively. To style a cell in the 2nd row and 3rd column, we can do:\n\ntt(x) |>\n style_tt(\n i = 2,\n j = 3,\n background = \"black\",\n color = \"white\")\n\n\n \n\n \n \n \n tinytable_frdwkdr9ui81exw8htl2\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nThe i and j accept vectors of integers to modify several cells at once:\n\ntt(x) |>\n style_tt(\n i = 2:3,\n j = c(1, 3, 4),\n italic = TRUE,\n color = \"orange\")\n\n\n \n\n \n \n \n tinytable_dgsxhqzlvmdugxx4w5yu\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nWe can style all cells in a table by omitting both the i and j arguments:\n\ntt(x) |> style_tt(color = \"orange\")\n\n\n \n\n \n \n \n tinytable_n02vl7fd0qn07wt7hluo\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nWe can style entire rows by omitting the j argument:\n\ntt(x) |> style_tt(i = 1:2, color = \"orange\")\n\n\n \n\n \n \n \n tinytable_dd01bx8j5v0dray2znpp\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nWe can style entire columns by omitting the i argument:\n\ntt(x) |> style_tt(j = c(2, 4), bold = TRUE)\n\n\n \n\n \n \n \n tinytable_vgeqsdkd0aezr84z2p06\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nThe j argument accepts integer vectors, but also a string with a Perl-style regular expression, which makes it easier to select columns by name:\n\ntt(x) |> style_tt(j = \"mpg|drat\", color = \"orange\")\n\n\n \n\n \n \n \n tinytable_jtwh5lm2098z6cyff0kk\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nOf course, we can also call the style_tt() function several times to apply different styles to different parts of the table:\n\ntt(x) |> \n style_tt(i = 1, j = 1:2, color = \"orange\") |>\n style_tt(i = 1, j = 3:4, color = \"green\")\n\n\n \n\n \n \n \n tinytable_31vm2rzi4os8gh80aqy9\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "vignettes/tutorial.html#colors",
"href": "vignettes/tutorial.html#colors",
"title": "tinytable",
"section": "Colors",
- "text": "Colors\nThe color and background arguments in the style_tt() function are used for specifying the text color and the background color for cells of a table created by the tt() function. This argument plays a crucial role in enhancing the visual appeal and readability of the table, whether it’s rendered in LaTeX or HTML format. The way we specify colors differs slightly between the two formats:\nFor HTML Output:\n\nHex Codes: You can specify colors using hexadecimal codes, which consist of a # followed by 6 characters (e.g., #CC79A7). This allows for a wide range of colors.\nKeywords: There’s also the option to use color keywords for convenience. The supported keywords are basic color names like black, red, blue, etc.\n\nFor LaTeX Output:\n\nHexadecimal Codes: Similar to HTML, you can use hexadecimal codes. However, in LaTeX, you need to include these codes as strings (e.g., \"#CC79A7\").\nKeywords: LaTeX supports a different set of color keywords, which include standard colors like black, red, blue, as well as additional ones like cyan, darkgray, lightgray, etc.\nColor Blending: An advanced feature in LaTeX is color blending, which can be achieved using the xcolor package. You can blend colors by specifying ratios (e.g., white!80!blue or green!20!red).\nLuminance Levels: The ninecolors package in LaTeX offers colors with predefined luminance levels, allowing for more nuanced color choices (e.g., “azure4”, “magenta8”).\n\nNote that the keywords used in LaTeX and HTML are slightly different.\n\ntt(x) |> style_tt(i = 1:4, j = 1, color = \"#FF5733\")\n\n\n \n\n \n \n \n tinytable_cg63m5uruyupmlk8eoxr\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nNote that when using Hex codes in a LaTeX table, we need extra declarations in the LaTeX preamble. See ?tt for details."
+ "text": "Colors\nThe color and background arguments in the style_tt() function are used for specifying the text color and the background color for cells of a table created by the tt() function. This argument plays a crucial role in enhancing the visual appeal and readability of the table, whether it’s rendered in LaTeX or HTML format. The way we specify colors differs slightly between the two formats:\nFor HTML Output:\n\nHex Codes: You can specify colors using hexadecimal codes, which consist of a # followed by 6 characters (e.g., #CC79A7). This allows for a wide range of colors.\nKeywords: There’s also the option to use color keywords for convenience. The supported keywords are basic color names like black, red, blue, etc.\n\nFor LaTeX Output:\n\nHexadecimal Codes: Similar to HTML, you can use hexadecimal codes. However, in LaTeX, you need to include these codes as strings (e.g., \"#CC79A7\").\nKeywords: LaTeX supports a different set of color keywords, which include standard colors like black, red, blue, as well as additional ones like cyan, darkgray, lightgray, etc.\nColor Blending: An advanced feature in LaTeX is color blending, which can be achieved using the xcolor package. You can blend colors by specifying ratios (e.g., white!80!blue or green!20!red).\nLuminance Levels: The ninecolors package in LaTeX offers colors with predefined luminance levels, allowing for more nuanced color choices (e.g., “azure4”, “magenta8”).\n\nNote that the keywords used in LaTeX and HTML are slightly different.\n\ntt(x) |> style_tt(i = 1:4, j = 1, color = \"#FF5733\")\n\n\n \n\n \n \n \n tinytable_cwph3sx0g7ez3j6nyul4\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nNote that when using Hex codes in a LaTeX table, we need extra declarations in the LaTeX preamble. See ?tt for details."
},
{
"objectID": "vignettes/tutorial.html#fonts",
"href": "vignettes/tutorial.html#fonts",
"title": "tinytable",
"section": "Fonts",
- "text": "Fonts\nThe font size is specified in terms of pt units, where 1pt=1.333px:\n\ntt(x) |> style_tt(j = \"mpg|hp|qsec\", fontsize = 18)\n\n\n \n\n \n \n \n tinytable_h1rgy29wtiqrsk0dkj81\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "Fonts\nThe font size is specified in terms of pt units, where 1pt=1.333px:\n\ntt(x) |> style_tt(j = \"mpg|hp|qsec\", fontsize = 18)\n\n\n \n\n \n \n \n tinytable_whzh1lnv2w3tbes06swh\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "vignettes/tutorial.html#headers",
"href": "vignettes/tutorial.html#headers",
"title": "tinytable",
"section": "Headers",
- "text": "Headers\nThe header can be omitted from the table by deleting the column names in the x data frame:\n\nk <- x\ncolnames(k) <- NULL\ntt(k)\n\n\n \n\n \n \n \n tinytable_hmpkkpdnzmoc9wijzdn4\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\n\nThe header is row 0, and can thus be styled as expected:\n\ntt(x) |> style_tt(i = 0, color = \"white\", background = \"black\")\n\n\n \n\n \n \n \n tinytable_l8i7eyxz3tgvbvzalfo3\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "Headers\nThe header can be omitted from the table by deleting the column names in the x data frame:\n\nk <- x\ncolnames(k) <- NULL\ntt(k)\n\n\n \n\n \n \n \n tinytable_cguofaigsfb02y39a95f\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\n\nThe header is row 0, and can thus be styled as expected:\n\ntt(x) |> style_tt(i = 0, color = \"white\", background = \"black\")\n\n\n \n\n \n \n \n tinytable_ca7csa2knww09qxj69sn\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "vignettes/tutorial.html#conditional-styling",
"href": "vignettes/tutorial.html#conditional-styling",
"title": "tinytable",
"section": "Conditional styling",
- "text": "Conditional styling\nWe can use the standard which function from Base R to create indices and apply conditional stying on rows. And we can use a regular expression in j to apply conditional styling on columns:\n\nk <- mtcars[1:10, c(\"mpg\", \"am\", \"vs\")]\n\ntt(k) |> \n style_tt(\n i = which(k$am == k$vs),\n background = \"teal\",\n color = \"white\")\n\n\n \n\n \n \n \n tinytable_u6kyzh2t6mx0dbeqqbm2\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n am\n vs\n \n \n \n \n \n 21\n 1\n 0\n \n \n 21\n 1\n 0\n \n \n 22.8\n 1\n 1\n \n \n 21.4\n 0\n 1\n \n \n 18.7\n 0\n 0\n \n \n 18.1\n 0\n 1\n \n \n 14.3\n 0\n 0\n \n \n 24.4\n 0\n 1\n \n \n 22.8\n 0\n 1\n \n \n 19.2\n 0\n 1"
+ "text": "Conditional styling\nWe can use the standard which function from Base R to create indices and apply conditional stying on rows. And we can use a regular expression in j to apply conditional styling on columns:\n\nk <- mtcars[1:10, c(\"mpg\", \"am\", \"vs\")]\n\ntt(k) |> \n style_tt(\n i = which(k$am == k$vs),\n background = \"teal\",\n color = \"white\")\n\n\n \n\n \n \n \n tinytable_63qdaqv592m2k5hqyhyr\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n am\n vs\n \n \n \n \n \n 21\n 1\n 0\n \n \n 21\n 1\n 0\n \n \n 22.8\n 1\n 1\n \n \n 21.4\n 0\n 1\n \n \n 18.7\n 0\n 0\n \n \n 18.1\n 0\n 1\n \n \n 14.3\n 0\n 0\n \n \n 24.4\n 0\n 1\n \n \n 22.8\n 0\n 1\n \n \n 19.2\n 0\n 1"
},
{
"objectID": "vignettes/tutorial.html#vectorized-styling-heatmaps",
"href": "vignettes/tutorial.html#vectorized-styling-heatmaps",
"title": "tinytable",
"section": "Vectorized styling (heatmaps)",
- "text": "Vectorized styling (heatmaps)\nThe color, background, and fontsize arguments are vectorized. This allows easy specification of different colors in a single call:\n\ntt(x) |> style_tt(i = 1:4, color = c(\"red\", \"blue\", \"green\", \"orange\"))\n\n\n \n\n \n \n \n tinytable_5fzekfhb78oesj5m9a7d\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nWhen using a single value for a vectorized argument, it gets applied to all values:\n\ntt(x) |>\n style_tt(\n j = 2:3,\n color = c(\"orange\", \"green\"),\n background = \"black\")\n\n\n \n\n \n \n \n tinytable_0tb9b17nmwwipd3kbkna\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nWe can also produce more complex heatmap-like tables:\n\n# A table without header\nk <- data.frame(matrix(1:20, ncol = 5))\ncolnames(k) <- NULL\n\n# 20 levels of Inferno colors\nbg <- hcl.colors(20, \"Inferno\")\nfs <- 1:20\n\ntt(k, width = .5, theme = \"void\") |>\n style_tt(\n i = 1:4,\n j = 1:5,\n color = \"white\",\n background = bg,\n fontsize = fs)\n\n\n \n\n \n \n \n tinytable_hhm2iu6oun3p0fzd7s0m\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n 1\n 5\n 9\n 13\n 17\n \n \n 2\n 6\n 10\n 14\n 18\n \n \n 3\n 7\n 11\n 15\n 19\n \n \n 4\n 8\n 12\n 16\n 20"
+ "text": "Vectorized styling (heatmaps)\nThe color, background, and fontsize arguments are vectorized. This allows easy specification of different colors in a single call:\n\ntt(x) |> style_tt(i = 1:4, color = c(\"red\", \"blue\", \"green\", \"orange\"))\n\n\n \n\n \n \n \n tinytable_b5a52fa45yty8r34g0al\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nWhen using a single value for a vectorized argument, it gets applied to all values:\n\ntt(x) |>\n style_tt(\n j = 2:3,\n color = c(\"orange\", \"green\"),\n background = \"black\")\n\n\n \n\n \n \n \n tinytable_oakb4zs9jhh6ly7u7cru\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\nWe can also produce more complex heatmap-like tables:\n\n# A table without header\nk <- data.frame(matrix(1:20, ncol = 5))\ncolnames(k) <- NULL\n\n# 20 levels of Inferno colors\nbg <- hcl.colors(20, \"Inferno\")\nfs <- 1:20\n\ntt(k, width = .5, theme = \"void\") |>\n style_tt(\n i = 1:4,\n j = 1:5,\n color = \"white\",\n background = bg,\n fontsize = fs)\n\n\n \n\n \n \n \n tinytable_yr6lfdkkly38isyxlkmu\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n 1\n 5\n 9\n 13\n 17\n \n \n 2\n 6\n 10\n 14\n 18\n \n \n 3\n 7\n 11\n 15\n 19\n \n \n 4\n 8\n 12\n 16\n 20"
},
{
"objectID": "vignettes/tutorial.html#rows",
"href": "vignettes/tutorial.html#rows",
"title": "tinytable",
"section": "Rows",
- "text": "Rows\nThe i argument accepts a named list of integers. The numbers identify the positions where row group labels are to be inserted. The names includes the text that should be inserted:\n\ndat <- mtcars[1:9, 1:8]\n\ntt(dat) |>\n group_tt(i = list(\n \"I like (fake) hamburgers\" = 3,\n \"She prefers halloumi\" = 4,\n \"They love tofu\" = 7))\n\n\n \n\n \n \n \n tinytable_c8pv8hhfjwn5u8tbl1mx\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n wt\n qsec\n vs\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.62\n 16.46\n 0\n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.875\n 17.02\n 0\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n 2.32\n 18.61\n 1\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n 3.215\n 19.44\n 1\n \n \n 18.7\n 8\n 360\n 175\n 3.15\n 3.44\n 17.02\n 0\n \n \n 18.1\n 6\n 225\n 105\n 2.76\n 3.46\n 20.22\n 1\n \n \n 14.3\n 8\n 360\n 245\n 3.21\n 3.57\n 15.84\n 0\n \n \n 24.4\n 4\n 146.7\n 62\n 3.69\n 3.19\n 20\n 1\n \n \n 22.8\n 4\n 140.8\n 95\n 3.92\n 3.15\n 22.9\n 1\n \n \n \n \n\n \n \n\n \n\n\n\n\nThe group_tt() function only includes a few arguments: x, i, j, and indent. But whenever we call group_tt(), the function will automatically apply a style_tt() call to all the new group labels, using any extra argument supplied to group_tt() (arguments are pushed via ...). This means that we can apply all the usual stying options to row labels:\n\ntt(dat) |> \n group_tt(\n align = \"c\",\n color = \"white\",\n background = \"gray\",\n bold = TRUE,\n i = list(\n \"I like (fake) hamburgers\" = 3,\n \"She prefers halloumi\" = 4,\n \"They love tofu\" = 7))\n\n\n \n\n \n \n \n tinytable_vm3hdn7wloka5hkx7qsj\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n wt\n qsec\n vs\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.62\n 16.46\n 0\n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.875\n 17.02\n 0\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n 2.32\n 18.61\n 1\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n 3.215\n 19.44\n 1\n \n \n 18.7\n 8\n 360\n 175\n 3.15\n 3.44\n 17.02\n 0\n \n \n 18.1\n 6\n 225\n 105\n 2.76\n 3.46\n 20.22\n 1\n \n \n 14.3\n 8\n 360\n 245\n 3.21\n 3.57\n 15.84\n 0\n \n \n 24.4\n 4\n 146.7\n 62\n 3.69\n 3.19\n 20\n 1\n \n \n 22.8\n 4\n 140.8\n 95\n 3.92\n 3.15\n 22.9\n 1"
+ "text": "Rows\nThe i argument accepts a named list of integers. The numbers identify the positions where row group labels are to be inserted. The names includes the text that should be inserted:\n\ndat <- mtcars[1:9, 1:8]\n\ntt(dat) |>\n group_tt(i = list(\n \"I like (fake) hamburgers\" = 3,\n \"She prefers halloumi\" = 4,\n \"They love tofu\" = 7))\n\n\n \n\n \n \n \n tinytable_qu3l48ig0ubxjjfayllz\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n wt\n qsec\n vs\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.62\n 16.46\n 0\n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.875\n 17.02\n 0\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n 2.32\n 18.61\n 1\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n 3.215\n 19.44\n 1\n \n \n 18.7\n 8\n 360\n 175\n 3.15\n 3.44\n 17.02\n 0\n \n \n 18.1\n 6\n 225\n 105\n 2.76\n 3.46\n 20.22\n 1\n \n \n 14.3\n 8\n 360\n 245\n 3.21\n 3.57\n 15.84\n 0\n \n \n 24.4\n 4\n 146.7\n 62\n 3.69\n 3.19\n 20\n 1\n \n \n 22.8\n 4\n 140.8\n 95\n 3.92\n 3.15\n 22.9\n 1\n \n \n \n \n\n \n \n\n \n\n\n\n\nThe group_tt() function only includes a few arguments: x, i, j, and indent. But whenever we call group_tt(), the function will automatically apply a style_tt() call to all the new group labels, using any extra argument supplied to group_tt() (arguments are pushed via ...). This means that we can apply all the usual stying options to row labels:\n\ntt(dat) |> \n group_tt(\n align = \"c\",\n color = \"white\",\n background = \"gray\",\n bold = TRUE,\n i = list(\n \"I like (fake) hamburgers\" = 3,\n \"She prefers halloumi\" = 4,\n \"They love tofu\" = 7))\n\n\n \n\n \n \n \n tinytable_wx0kq8bqp4iyvn507it4\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n wt\n qsec\n vs\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.62\n 16.46\n 0\n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.875\n 17.02\n 0\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n 2.32\n 18.61\n 1\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n 3.215\n 19.44\n 1\n \n \n 18.7\n 8\n 360\n 175\n 3.15\n 3.44\n 17.02\n 0\n \n \n 18.1\n 6\n 225\n 105\n 2.76\n 3.46\n 20.22\n 1\n \n \n 14.3\n 8\n 360\n 245\n 3.21\n 3.57\n 15.84\n 0\n \n \n 24.4\n 4\n 146.7\n 62\n 3.69\n 3.19\n 20\n 1\n \n \n 22.8\n 4\n 140.8\n 95\n 3.92\n 3.15\n 22.9\n 1"
},
{
"objectID": "vignettes/tutorial.html#columns",
"href": "vignettes/tutorial.html#columns",
"title": "tinytable",
"section": "Columns",
- "text": "Columns\nThe syntax for column groups is very similar, but we use the j argument instead. The named list specifies the labels to appear in column-spanning labels, and the values must be a vector of consecutive and non-overlapping integers that indicate which columns are associated to which labels:\n\ntt(dat) |> \n group_tt(\n j = list(\n \"Hamburgers\" = 1:3,\n \"Halloumi\" = 4:5,\n \"Tofu\" = 7))\n\n\n \n\n \n \n \n tinytable_5txd9zonfyduq95ysftx\n \n \n \n \n \n \n\n \n \n \n \nHamburgers\nHalloumi\n \nTofu\n \n \n \n mpg\n cyl\n disp\n hp\n drat\n wt\n qsec\n vs\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.62\n 16.46\n 0\n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.875\n 17.02\n 0\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n 2.32\n 18.61\n 1\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n 3.215\n 19.44\n 1\n \n \n 18.7\n 8\n 360\n 175\n 3.15\n 3.44\n 17.02\n 0\n \n \n 18.1\n 6\n 225\n 105\n 2.76\n 3.46\n 20.22\n 1\n \n \n 14.3\n 8\n 360\n 245\n 3.21\n 3.57\n 15.84\n 0\n \n \n 24.4\n 4\n 146.7\n 62\n 3.69\n 3.19\n 20\n 1\n \n \n 22.8\n 4\n 140.8\n 95\n 3.92\n 3.15\n 22.9\n 1\n \n \n \n \n\n \n \n\n \n\n\n\n\nAs above, we can pass additional styling options to the style_tt() function automatically via .... This means that all the arguments like italic, bold, color and friends can be used to style spanning column headers:\n\ndat <- mtcars[1:9, 1:8]\ntt(dat) |> \n group_tt(color = \"teal\", italic = TRUE,\n j = list(\"Hamburgers\" = 1:3,\n \"Halloumi\" = 4:5,\n \"Tofu\" = 7),\n i = list(\"I like (fake) hamburgers\" = 3,\n \"She prefers halloumi\" = 4,\n \"They love tofu\" = 7))\n\n\n \n\n \n \n \n tinytable_n7nxxk1ej45hf0h10t6y\n \n \n \n \n \n \n\n \n \n \n \nHamburgers\nHalloumi\n \nTofu\n \n \n \n mpg\n cyl\n disp\n hp\n drat\n wt\n qsec\n vs\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.62\n 16.46\n 0\n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.875\n 17.02\n 0\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n 2.32\n 18.61\n 1\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n 3.215\n 19.44\n 1\n \n \n 18.7\n 8\n 360\n 175\n 3.15\n 3.44\n 17.02\n 0\n \n \n 18.1\n 6\n 225\n 105\n 2.76\n 3.46\n 20.22\n 1\n \n \n 14.3\n 8\n 360\n 245\n 3.21\n 3.57\n 15.84\n 0\n \n \n 24.4\n 4\n 146.7\n 62\n 3.69\n 3.19\n 20\n 1\n \n \n 22.8\n 4\n 140.8\n 95\n 3.92\n 3.15\n 22.9\n 1\n \n \n \n \n\n \n \n\n \n\n\n\n\nOr call twice for different stylings for row and column groups:\n\ndat <- mtcars[1:9, 1:8]\ntt(dat) |> \n group_tt(color = \"teal\", italic = TRUE,\n j = list(\"Hamburgers\" = 1:3,\n \"Halloumi\" = 4:5,\n \"Tofu\" = 7)) |>\n group_tt(align = \"c\", color = \"white\", background = \"teal\", bold = TRUE,\n i = list(\"I like (fake) hamburgers\" = 3,\n \"She prefers halloumi\" = 4,\n \"They love tofu\" = 7))\n\n\n \n\n \n \n \n tinytable_7537qcz8wpxgnr9ljdj6\n \n \n \n \n \n \n\n \n \n \n \nHamburgers\nHalloumi\n \nTofu\n \n \n \n mpg\n cyl\n disp\n hp\n drat\n wt\n qsec\n vs\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.62\n 16.46\n 0\n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.875\n 17.02\n 0\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n 2.32\n 18.61\n 1\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n 3.215\n 19.44\n 1\n \n \n 18.7\n 8\n 360\n 175\n 3.15\n 3.44\n 17.02\n 0\n \n \n 18.1\n 6\n 225\n 105\n 2.76\n 3.46\n 20.22\n 1\n \n \n 14.3\n 8\n 360\n 245\n 3.21\n 3.57\n 15.84\n 0\n \n \n 24.4\n 4\n 146.7\n 62\n 3.69\n 3.19\n 20\n 1\n \n \n 22.8\n 4\n 140.8\n 95\n 3.92\n 3.15\n 22.9\n 1"
+ "text": "Columns\nThe syntax for column groups is very similar, but we use the j argument instead. The named list specifies the labels to appear in column-spanning labels, and the values must be a vector of consecutive and non-overlapping integers that indicate which columns are associated to which labels:\n\ntt(dat) |> \n group_tt(\n j = list(\n \"Hamburgers\" = 1:3,\n \"Halloumi\" = 4:5,\n \"Tofu\" = 7))\n\n\n \n\n \n \n \n tinytable_9dentixa76l3bcmuv2ln\n \n \n \n \n \n \n\n \n \n \n \nHamburgers\nHalloumi\n \nTofu\n \n \n \n mpg\n cyl\n disp\n hp\n drat\n wt\n qsec\n vs\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.62\n 16.46\n 0\n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.875\n 17.02\n 0\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n 2.32\n 18.61\n 1\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n 3.215\n 19.44\n 1\n \n \n 18.7\n 8\n 360\n 175\n 3.15\n 3.44\n 17.02\n 0\n \n \n 18.1\n 6\n 225\n 105\n 2.76\n 3.46\n 20.22\n 1\n \n \n 14.3\n 8\n 360\n 245\n 3.21\n 3.57\n 15.84\n 0\n \n \n 24.4\n 4\n 146.7\n 62\n 3.69\n 3.19\n 20\n 1\n \n \n 22.8\n 4\n 140.8\n 95\n 3.92\n 3.15\n 22.9\n 1\n \n \n \n \n\n \n \n\n \n\n\n\n\nAs above, we can pass additional styling options to the style_tt() function automatically via .... This means that all the arguments like italic, bold, color and friends can be used to style spanning column headers:\n\ndat <- mtcars[1:9, 1:8]\ntt(dat) |> \n group_tt(color = \"teal\", italic = TRUE,\n j = list(\"Hamburgers\" = 1:3,\n \"Halloumi\" = 4:5,\n \"Tofu\" = 7),\n i = list(\"I like (fake) hamburgers\" = 3,\n \"She prefers halloumi\" = 4,\n \"They love tofu\" = 7))\n\n\n \n\n \n \n \n tinytable_0ofjbquratlfmipzkzpm\n \n \n \n \n \n \n\n \n \n \n \nHamburgers\nHalloumi\n \nTofu\n \n \n \n mpg\n cyl\n disp\n hp\n drat\n wt\n qsec\n vs\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.62\n 16.46\n 0\n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.875\n 17.02\n 0\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n 2.32\n 18.61\n 1\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n 3.215\n 19.44\n 1\n \n \n 18.7\n 8\n 360\n 175\n 3.15\n 3.44\n 17.02\n 0\n \n \n 18.1\n 6\n 225\n 105\n 2.76\n 3.46\n 20.22\n 1\n \n \n 14.3\n 8\n 360\n 245\n 3.21\n 3.57\n 15.84\n 0\n \n \n 24.4\n 4\n 146.7\n 62\n 3.69\n 3.19\n 20\n 1\n \n \n 22.8\n 4\n 140.8\n 95\n 3.92\n 3.15\n 22.9\n 1\n \n \n \n \n\n \n \n\n \n\n\n\n\nOr call twice for different stylings for row and column groups:\n\ndat <- mtcars[1:9, 1:8]\ntt(dat) |> \n group_tt(color = \"teal\", italic = TRUE,\n j = list(\"Hamburgers\" = 1:3,\n \"Halloumi\" = 4:5,\n \"Tofu\" = 7)) |>\n group_tt(align = \"c\", color = \"white\", background = \"teal\", bold = TRUE,\n i = list(\"I like (fake) hamburgers\" = 3,\n \"She prefers halloumi\" = 4,\n \"They love tofu\" = 7))\n\n\n \n\n \n \n \n tinytable_ezcnofpvg2ojeh9mnj0g\n \n \n \n \n \n \n\n \n \n \n \nHamburgers\nHalloumi\n \nTofu\n \n \n \n mpg\n cyl\n disp\n hp\n drat\n wt\n qsec\n vs\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.62\n 16.46\n 0\n \n \n 21\n 6\n 160\n 110\n 3.9\n 2.875\n 17.02\n 0\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n 2.32\n 18.61\n 1\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n 3.215\n 19.44\n 1\n \n \n 18.7\n 8\n 360\n 175\n 3.15\n 3.44\n 17.02\n 0\n \n \n 18.1\n 6\n 225\n 105\n 2.76\n 3.46\n 20.22\n 1\n \n \n 14.3\n 8\n 360\n 245\n 3.21\n 3.57\n 15.84\n 0\n \n \n 24.4\n 4\n 146.7\n 62\n 3.69\n 3.19\n 20\n 1\n \n \n 22.8\n 4\n 140.8\n 95\n 3.92\n 3.15\n 22.9\n 1"
},
{
"objectID": "vignettes/tutorial.html#themes-1",
"href": "vignettes/tutorial.html#themes-1",
"title": "tinytable",
"section": "Themes",
- "text": "Themes\nThe Bootstrap framework provides a number of built-in themes to style tables. To use them, we call bootstrapOptions() with the class argument, and we specify the Bootstrap class. A list of available Bootstrap classes can be found here: https://getbootstrap.com/docs/5.3/content/tables/\nFor example, to produce a “dark” table, we use the table-dark class:\n\ntt(x, theme = \"table table-dark\")\n\n\n \n\n \n \n \n tinytable_ce7j99b9e3s9tkv6oco8\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\n\nWe can also combine several Bootstrap classes. Here, we get a “striped” table with the “warning” color and hover feature:\n\ntt(x, theme = \"table table-striped table-warning table-hover\")\n\n\n \n\n \n \n \n tinytable_ngmf05v2v6j0kvn9nyka\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "Themes\nThe Bootstrap framework provides a number of built-in themes to style tables. To use them, we call bootstrapOptions() with the class argument, and we specify the Bootstrap class. A list of available Bootstrap classes can be found here: https://getbootstrap.com/docs/5.3/content/tables/\nFor example, to produce a “dark” table, we use the table-dark class:\n\ntt(x, theme = \"table table-dark\")\n\n\n \n\n \n \n \n tinytable_x1mnhkwvagli5ci8hryy\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08\n \n \n \n \n\n \n \n\n \n\n\n\n\n\nWe can also combine several Bootstrap classes. Here, we get a “striped” table with the “warning” color and hover feature:\n\ntt(x, theme = \"table table-striped table-warning table-hover\")\n\n\n \n\n \n \n \n tinytable_rvjh9okar4icqitwnpoo\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "vignettes/tutorial.html#css-declarations",
"href": "vignettes/tutorial.html#css-declarations",
"title": "tinytable",
"section": "CSS declarations",
- "text": "CSS declarations\nThe style_tt() function allows us to declare CSS properties and values for individual cells, columns, or rows of a table. For example, if we want to make the first column bold, we could do:\n\ntt(x) |>\n style_tt(j = 1, bootstrap_css = \"font-weight: bold; color: red;\")\n\n\n \n\n \n \n \n tinytable_2n88bo7ngxp915b8mme9\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "CSS declarations\nThe style_tt() function allows us to declare CSS properties and values for individual cells, columns, or rows of a table. For example, if we want to make the first column bold, we could do:\n\ntt(x) |>\n style_tt(j = 1, bootstrap_css = \"font-weight: bold; color: red;\")\n\n\n \n\n \n \n \n tinytable_exeehdp9b4ag02y9d7od\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "vignettes/tutorial.html#css-rules",
"href": "vignettes/tutorial.html#css-rules",
"title": "tinytable",
"section": "CSS rules",
- "text": "CSS rules\nFor more extensive customization, we can use complete CSS rules. In this example, we define several rules that apply to a new class called mytable. Then, we use the theme argument of the tt() function to ensure that our tiny table is of class mytable. Finally, we call style_bootstrap() to apply the rules with the bootstrap_css_rule argument.\n\ncss_rule <- \"\n.mytable {\n background: linear-gradient(45deg, #EA8D8D, #A890FE);\n width: 600px;\n border-collapse: collapse;\n overflow: hidden;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n}\n\n.mytable th,\n.mytable td {\n padding: 5px;\n background-color: rgba(255,255,255,0.2);\n color: #fff;\n}\n\n.mytable tbody tr:hover {\n background-color: rgba(255,255,255,0.3);\n}\n\n.mytable tbody td:hover:before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n top: -9999px;\n bottom: -9999px;\n background-color: rgba(255,255,255,0.2);\n z-index: -1;\n}\n\"\n\ntt(x, align = \"ccccc\", theme = \"table mytable\", width = 2/3) |> \n style_tt(bootstrap_css_rule = css_rule)\n\n\n \n\n \n \n \n tinytable_l73y74vtyca3h7cous37\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
+ "text": "CSS rules\nFor more extensive customization, we can use complete CSS rules. In this example, we define several rules that apply to a new class called mytable. Then, we use the theme argument of the tt() function to ensure that our tiny table is of class mytable. Finally, we call style_bootstrap() to apply the rules with the bootstrap_css_rule argument.\n\ncss_rule <- \"\n.mytable {\n background: linear-gradient(45deg, #EA8D8D, #A890FE);\n width: 600px;\n border-collapse: collapse;\n overflow: hidden;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n}\n\n.mytable th,\n.mytable td {\n padding: 5px;\n background-color: rgba(255,255,255,0.2);\n color: #fff;\n}\n\n.mytable tbody tr:hover {\n background-color: rgba(255,255,255,0.3);\n}\n\n.mytable tbody td:hover:before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n top: -9999px;\n bottom: -9999px;\n background-color: rgba(255,255,255,0.2);\n z-index: -1;\n}\n\"\n\ntt(x, align = \"ccccc\", theme = \"table mytable\", width = 2/3) |> \n style_tt(bootstrap_css_rule = css_rule)\n\n\n \n\n \n \n \n tinytable_ese2litcj5r386u5pusl\n \n \n \n \n \n \n\n \n \n \n \n \n \n mpg\n cyl\n disp\n hp\n drat\n \n \n \n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 21\n 6\n 160\n 110\n 3.9\n \n \n 22.8\n 4\n 108\n 93\n 3.85\n \n \n 21.4\n 6\n 258\n 110\n 3.08"
},
{
"objectID": "vignettes/tutorial.html#preamble",
diff --git a/vignettes/tutorial.html b/vignettes/tutorial.html
index b49e6cf2..4e1eff10 100644
--- a/vignettes/tutorial.html
+++ b/vignettes/tutorial.html
@@ -323,7 +323,7 @@ Tiny Tables
- tinytable_ufsajawdwwajwr5bip20
+ tinytable_zs8gfu947vtb1px5jz84
@@ -343,7 +343,7 @@ Tiny Tables
-
+
@@ -390,12 +390,12 @@ Tiny Tables
@@ -670,7 +670,7 @@ Alignment
-
+
@@ -717,42 +717,42 @@ Alignment
@@ -773,7 +773,7 @@ Width
- tinytable_enh5fdh3vzdzhg5933a6
+ tinytable_p0083bvr9m05h95imzjk
@@ -793,7 +793,7 @@ Width
-
+
@@ -840,12 +840,12 @@ Width
@@ -1423,7 +1423,7 @@ Math
-
+
@@ -1444,20 +1444,20 @@ Math
@@ -1508,10 +1508,10 @@ Cells, rows, columns
- tinytable_x3n2l75l4ooq4096xqqn
+ tinytable_frdwkdr9ui81exw8htl2
@@ -1529,7 +1529,7 @@ Cells, rows, columns
-
+
@@ -1576,18 +1576,18 @@ Cells, rows, columns
@@ -1610,15 +1610,15 @@ Cells, rows, columns
- tinytable_nlmvc0rsgyse936a2wsj
+ tinytable_dgsxhqzlvmdugxx4w5yu
@@ -1636,7 +1636,7 @@ Cells, rows, columns
-
+
@@ -1683,23 +1683,23 @@ Cells, rows, columns
@@ -1717,29 +1717,29 @@ Cells, rows, columns
- tinytable_2lq3lyn87qelfza1um0e
+ tinytable_n02vl7fd0qn07wt7hluo
@@ -1757,7 +1757,7 @@ Cells, rows, columns
-
+
@@ -1804,37 +1804,37 @@ Cells, rows, columns
@@ -1852,19 +1852,19 @@ Cells, rows, columns
- tinytable_26v60diyjfit17pondfh
+ tinytable_dd01bx8j5v0dray2znpp
@@ -1882,7 +1882,7 @@ Cells, rows, columns
-
+
@@ -1929,27 +1929,27 @@ Cells, rows, columns
@@ -1967,17 +1967,17 @@ Cells, rows, columns
- tinytable_3c1oh4l9jkybnrxefm66
+ tinytable_vgeqsdkd0aezr84z2p06
@@ -1995,7 +1995,7 @@ Cells, rows, columns
-
+
@@ -2042,25 +2042,25 @@ Cells, rows, columns
@@ -2078,17 +2078,17 @@ Cells, rows, columns
- tinytable_64kwh7hxb4wq7lheh5jd
+ tinytable_jtwh5lm2098z6cyff0kk
@@ -2106,7 +2106,7 @@ Cells, rows, columns
-
+
@@ -2153,25 +2153,25 @@ Cells, rows, columns
@@ -2191,13 +2191,13 @@ Cells, rows, columns
- tinytable_s740kko67yh647lzemmc
+ tinytable_31vm2rzi4os8gh80aqy9
@@ -2215,7 +2215,7 @@ Cells, rows, columns
-
+
@@ -2262,21 +2262,21 @@ Cells, rows, columns
@@ -2310,13 +2310,13 @@ Colors
- tinytable_cg63m5uruyupmlk8eoxr
+ tinytable_cwph3sx0g7ez3j6nyul4
@@ -2334,7 +2334,7 @@ Colors
-
+
@@ -2381,21 +2381,21 @@ Colors
@@ -2417,17 +2417,17 @@ Fonts
- tinytable_h1rgy29wtiqrsk0dkj81
+ tinytable_whzh1lnv2w3tbes06swh
@@ -2445,7 +2445,7 @@ Fonts
-
+
@@ -2492,25 +2492,25 @@ Fonts
@@ -2533,7 +2533,7 @@ Headers
- tinytable_hmpkkpdnzmoc9wijzdn4
+ tinytable_cguofaigsfb02y39a95f
@@ -2553,7 +2553,7 @@ Headers
-
+
@@ -2593,12 +2593,12 @@ Headers
@@ -2647,7 +2647,7 @@ Headers
-
+
@@ -2694,22 +2694,22 @@ Headers
@@ -2736,18 +2736,18 @@ Conditional styling
- tinytable_u6kyzh2t6mx0dbeqqbm2
+ tinytable_63qdaqv592m2k5hqyhyr
@@ -2765,7 +2765,7 @@ Conditional styling
-
+
@@ -2832,26 +2832,26 @@ Conditional styling
@@ -2872,29 +2872,29 @@ Vectorized sty
- tinytable_5fzekfhb78oesj5m9a7d
+ tinytable_b5a52fa45yty8r34g0al
@@ -2912,7 +2912,7 @@ Vectorized sty
-
+
@@ -2959,37 +2959,37 @@ Vectorized sty
@@ -3011,17 +3011,17 @@ Vectorized sty
- tinytable_0tb9b17nmwwipd3kbkna
+ tinytable_oakb4zs9jhh6ly7u7cru
@@ -3039,7 +3039,7 @@ Vectorized sty
-
+
@@ -3086,25 +3086,25 @@ Vectorized sty
@@ -3136,29 +3136,29 @@ Vectorized sty
- tinytable_hhm2iu6oun3p0fzd7s0m
+ tinytable_yr6lfdkkly38isyxlkmu
@@ -3176,7 +3176,7 @@ Vectorized sty
-
+
@@ -3216,37 +3216,37 @@ Vectorized sty
@@ -3277,21 +3277,21 @@ Rows
- tinytable_c8pv8hhfjwn5u8tbl1mx
+ tinytable_qu3l48ig0ubxjjfayllz
@@ -3309,7 +3309,7 @@ Rows
-
+
@@ -3421,32 +3421,32 @@ Rows
@@ -3473,45 +3473,45 @@ Rows
- tinytable_vm3hdn7wloka5hkx7qsj
+ tinytable_wx0kq8bqp4iyvn507it4
@@ -3529,7 +3529,7 @@ Rows
-
+
@@ -3641,56 +3641,56 @@ Rows
@@ -3716,7 +3716,7 @@ Columns
- tinytable_5txd9zonfyduq95ysftx
+ tinytable_9dentixa76l3bcmuv2ln
@@ -3736,7 +3736,7 @@ Columns
-
+
Hamburgers |
Halloumi |
@@ -3853,12 +3853,12 @@ Columns
@@ -3945,7 +3945,7 @@ Columns
-
+
Hamburgers |
Halloumi |
@@ -4062,56 +4062,56 @@ Columns
@@ -4138,45 +4138,45 @@ Columns
- tinytable_7537qcz8wpxgnr9ljdj6
+ tinytable_ezcnofpvg2ojeh9mnj0g
@@ -4194,7 +4194,7 @@ Columns
-
+
Hamburgers |
Halloumi |
@@ -4311,56 +4311,56 @@ Columns
@@ -4385,7 +4385,7 @@ Themes
- tinytable_ce7j99b9e3s9tkv6oco8
+ tinytable_x1mnhkwvagli5ci8hryy
@@ -4405,7 +4405,7 @@ Themes
-
+
@@ -4452,12 +4452,12 @@ Themes
@@ -4610,7 +4610,7 @@ CSS declarations
-
+
@@ -4657,29 +4657,29 @@ CSS declarations
@@ -4733,54 +4733,54 @@ CSS rules
- tinytable_l73y74vtyca3h7cous37
+ tinytable_ese2litcj5r386u5pusl
---|
---|
---|