diff --git a/man/tt.html b/man/tt.html index ed242a1e..7938d4c4 100644 --- a/man/tt.html +++ b/man/tt.html @@ -393,7 +393,7 @@

Examples

- tinytable_p3vnc23o43somcy6cu2h + tinytable_t1a2z86zgizzglkpf31q @@ -413,7 +413,7 @@

Examples

- +
@@ -460,12 +460,12 @@

Examples

@@ -520,7 +520,7 @@

Examples

-
+
@@ -567,42 +567,42 @@

Examples

diff --git a/search.json b/search.json index 82646fe6..22e7edaf 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_p3vnc23o43somcy6cu2h\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_w56xr63gtx0czgcjeaty\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_t1a2z86zgizzglkpf31q\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_pdzr5l6wedytinfpnwp6\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_p3vnc23o43somcy6cu2h\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_w56xr63gtx0czgcjeaty\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_t1a2z86zgizzglkpf31q\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_pdzr5l6wedytinfpnwp6\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_mj3ih6rdlx3ye22l7rzj\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_zzsnttbf7gxralyh6e78\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_ve1a7rp6e6pvmc0ofvki\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_7c832798jault7twc3wo\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_l0ubamaep975q3rx7ivi\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_im29cnr4komv8tbluqpf\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_ctk9hyso52mcgujcerwy\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_b8kh4rpo9db15z917qun\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_uujv3pwm6v9fahjjqrh1\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_6llb0xz451a7xe18xkoq\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_zdo3gkiesj6eyhoot872\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_md5sfece6e2nk4tu8b52\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_meuyxeq3zcxzj7rwxuzz\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_b9k8sqa515jfpvvs3zjc\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_xt5prryah6zihics9pdh\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_zj69z3l30rnsofgy8jvg\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_cpbseuztknr2ppjy80xw\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_fnqitx4ul1pyyqhfx9lt\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_j2z8c0c85nweih139rxw\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_otdgy9cip9upl79yuufq\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_szl3gdswb8vq60do6ces\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_afiddl453rwq19i73p7v\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_9skxhanpho0p7zmbgt5m\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_1dr1i6q2seci47jw2i2k\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_55yhpzqbtjt2wghzyoyg\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_aj0sqi7me8vnxghelcby\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_u1mdavv0ym8bby5l1jwa\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_ns0br5qynk20rjhx9vmk\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_n0xd5y3toal50zk7ot7k\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_bgoqynnex37ul11l0gld\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_q4pa54kr094n15ds3k3x\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_hhv07x358eelpbxdm82i\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_t315cj099f90rp6wbm0r\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_hj5hd1oiz1guk6w0kty1\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_2ruptkq53w0dh1o72uwr\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_83qej3c193zyhjzfz1oa\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_5fqnrddqk6o1kuaf6utr\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_shdq5o42fkhbcig4jio4\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_f7ksgngqq2r4pe5p58ff\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_vn0kpma9tjvrh9qm8sve\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_96lktuqsfxmmxvy8hvnu\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_6p41f5z8nugjvowsx4h5\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_vzmfwjnh6keuwjmdunn8\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_3h5l5bjwas5q2pb22scb\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_t758wc2tanc787l7mcsj\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_frlpa6xaw9plyp2g3ee6\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_eqiw38rcyn4q4ij4g0fg\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_zefgsiigti3u87rssh9s\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\")\nfg <- ifelse(as.matrix(k) < 17, tail(bg, 1), head(bg, 1))\nfs <- 1:20\n\ntt(k, width = .5, theme = \"void\", align = \"ccccc\") |>\n style_tt(\n i = 1:4,\n j = 1:5,\n color = fg,\n background = bg,\n fontsize = fs)\n\n\n \n\n \n \n \n tinytable_p7iurwigusg2ojznzkjy\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_6kqo4saxb5c9ows4viyw\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_8n1xiobzcw5pkezfv4cb\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\")\nfg <- ifelse(as.matrix(k) < 17, tail(bg, 1), head(bg, 1))\nfs <- 1:20\n\ntt(k, width = .5, theme = \"void\", align = \"ccccc\") |>\n style_tt(\n i = 1:4,\n j = 1:5,\n color = fg,\n background = bg,\n fontsize = fs)\n\n\n \n\n \n \n \n tinytable_bdmannz7gsxvttsfxqd0\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_rfs8mvymz8uymgudzjim\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_9xlevgrk4kepyqroshiv\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_jq5bj6xow81ctylby46j\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_9vkjh2mjh0kjvddbdsai\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_ctgwxg4b8knv7jm2hpsj\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_s75eyhq880644u74mi63\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_pbzszvie54upfodd9wmb\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_ay4r2isyhx7beouaxjve\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_51guyhesi4jy1u0buf5g\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_zksh05o69mhaydzxwlyu\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_j50jj6vh61hwdor3g38k\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_mkf5sm9dtnlup2bp3lyo\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_6zclf27vmf9t3jaayla8\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_c9f9gof0ja0bpy86vzgz\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_1tyiefun1e8oy3emeipn\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_0zarboqpeawe34sxncu7\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_qbmbf99s1oikeerbtypy\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_r03yulusqlkedqtvyywq\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 1781faa9..dba2b0b1 100644 --- a/vignettes/tutorial.html +++ b/vignettes/tutorial.html @@ -323,7 +323,7 @@

Tiny Tables

- tinytable_nrbrc4zhgkrs6x1k0zvl + tinytable_u7r035im5xqt58eew2kj @@ -343,7 +343,7 @@

Tiny Tables

-
Data about cars.
+
@@ -390,12 +390,12 @@

Tiny Tables

@@ -667,7 +667,7 @@

Alignment

-
+
@@ -714,42 +714,42 @@

Alignment

@@ -770,7 +770,7 @@

Width

- tinytable_ctk9hyso52mcgujcerwy + tinytable_uujv3pwm6v9fahjjqrh1 @@ -790,7 +790,7 @@

Width

-
+
@@ -837,12 +837,12 @@

Width

@@ -1419,7 +1419,7 @@

Math

-
+
@@ -1440,20 +1440,20 @@

Math

@@ -1504,10 +1504,10 @@

Cells, rows, columns - tinytable_9skxhanpho0p7zmbgt5m + tinytable_bgoqynnex37ul11l0gld @@ -1525,7 +1525,7 @@

Cells, rows, columns -

+
@@ -1572,18 +1572,18 @@

Cells, rows, columns @@ -1606,10 +1606,10 @@

Cells, rows, columns - tinytable_1dr1i6q2seci47jw2i2k + tinytable_q4pa54kr094n15ds3k3x @@ -1627,7 +1627,7 @@

Cells, rows, columns -

+
@@ -1674,23 +1674,23 @@

Cells, rows, columns @@ -1708,10 +1708,10 @@

Cells, rows, columns - tinytable_55yhpzqbtjt2wghzyoyg + tinytable_hhv07x358eelpbxdm82i @@ -1729,7 +1729,7 @@

Cells, rows, columns -

+
@@ -1776,37 +1776,37 @@

Cells, rows, columns @@ -1824,10 +1824,10 @@

Cells, rows, columns - tinytable_aj0sqi7me8vnxghelcby + tinytable_t315cj099f90rp6wbm0r @@ -1845,7 +1845,7 @@

Cells, rows, columns -

+
@@ -1892,27 +1892,27 @@

Cells, rows, columns @@ -1930,10 +1930,10 @@

Cells, rows, columns - tinytable_u1mdavv0ym8bby5l1jwa + tinytable_hj5hd1oiz1guk6w0kty1 @@ -1951,7 +1951,7 @@

Cells, rows, columns -

+
@@ -1998,25 +1998,25 @@

Cells, rows, columns @@ -2034,10 +2034,10 @@

Cells, rows, columns - tinytable_ns0br5qynk20rjhx9vmk + tinytable_2ruptkq53w0dh1o72uwr @@ -2055,7 +2055,7 @@

Cells, rows, columns -

+
@@ -2102,25 +2102,25 @@

Cells, rows, columns @@ -2140,11 +2140,11 @@

Cells, rows, columns - tinytable_n0xd5y3toal50zk7ot7k + tinytable_83qej3c193zyhjzfz1oa @@ -2162,7 +2162,7 @@

Cells, rows, columns -

+
@@ -2209,21 +2209,21 @@

Cells, rows, columns @@ -2257,10 +2257,10 @@

Colors

- tinytable_5fqnrddqk6o1kuaf6utr + tinytable_shdq5o42fkhbcig4jio4 @@ -2278,7 +2278,7 @@

Colors

-
+
@@ -2325,21 +2325,21 @@

Colors

@@ -2361,10 +2361,10 @@

Fonts

- tinytable_f7ksgngqq2r4pe5p58ff + tinytable_vn0kpma9tjvrh9qm8sve @@ -2382,7 +2382,7 @@

Fonts

-
+
@@ -2429,25 +2429,25 @@

Fonts

@@ -2470,7 +2470,7 @@

Headers

- tinytable_96lktuqsfxmmxvy8hvnu + tinytable_vzmfwjnh6keuwjmdunn8 @@ -2490,7 +2490,7 @@

Headers

-
+
@@ -2530,12 +2530,12 @@

Headers

@@ -2580,7 +2580,7 @@

Headers

-
+
@@ -2627,22 +2627,22 @@

Headers

@@ -2669,10 +2669,10 @@

Conditional styling - tinytable_t758wc2tanc787l7mcsj + tinytable_frlpa6xaw9plyp2g3ee6 @@ -2690,7 +2690,7 @@

Conditional styling -

+
@@ -2757,26 +2757,26 @@

Conditional styling @@ -2797,13 +2797,13 @@

Vectorized sty - tinytable_eqiw38rcyn4q4ij4g0fg + tinytable_6kqo4saxb5c9ows4viyw @@ -2821,7 +2821,7 @@

Vectorized sty
-

+
@@ -2868,37 +2868,37 @@

Vectorized sty @@ -2920,11 +2920,11 @@

Vectorized sty - tinytable_zefgsiigti3u87rssh9s + tinytable_8n1xiobzcw5pkezfv4cb @@ -2942,7 +2942,7 @@

Vectorized sty
-

+
@@ -2989,25 +2989,25 @@

Vectorized sty @@ -3040,39 +3040,39 @@

Vectorized sty - tinytable_p7iurwigusg2ojznzkjy + tinytable_bdmannz7gsxvttsfxqd0 @@ -3090,7 +3090,7 @@

Vectorized sty
-

+
@@ -3130,62 +3130,62 @@

Vectorized sty @@ -3216,10 +3216,10 @@

Rows

- tinytable_rfs8mvymz8uymgudzjim + tinytable_jq5bj6xow81ctylby46j @@ -3237,7 +3237,7 @@

Rows

-
+
@@ -3349,32 +3349,32 @@

Rows

@@ -3401,11 +3401,11 @@

Rows

- tinytable_9xlevgrk4kepyqroshiv + tinytable_9vkjh2mjh0kjvddbdsai @@ -3423,7 +3423,7 @@

Rows

-
+
@@ -3535,56 +3535,56 @@

Rows

@@ -3610,7 +3610,7 @@

Columns

- tinytable_ctgwxg4b8knv7jm2hpsj + tinytable_ay4r2isyhx7beouaxjve @@ -3630,7 +3630,7 @@

Columns

-
+
@@ -3747,12 +3747,12 @@

Columns

@@ -3805,7 +3805,7 @@

Columns

-
Hamburgers Halloumi
+
@@ -3922,56 +3922,56 @@

Columns

@@ -3998,11 +3998,11 @@

Columns

- tinytable_pbzszvie54upfodd9wmb + tinytable_zksh05o69mhaydzxwlyu @@ -4020,7 +4020,7 @@

Columns

-
Hamburgers Halloumi
+
@@ -4137,56 +4137,56 @@

Columns

@@ -4211,7 +4211,7 @@

Themes

- tinytable_j50jj6vh61hwdor3g38k + tinytable_6zclf27vmf9t3jaayla8 @@ -4231,7 +4231,7 @@

Themes

-
Hamburgers Halloumi
+
@@ -4278,12 +4278,12 @@

Themes

@@ -4428,7 +4428,7 @@

CSS declarations

-
+
@@ -4475,21 +4475,21 @@

CSS declarations

@@ -4543,20 +4543,20 @@

CSS rules

- tinytable_qbmbf99s1oikeerbtypy + tinytable_r03yulusqlkedqtvyywq