Questions tagged [kable]

Create Tables In LaTeX, HTML, Markdown And ReStructuredText

A function from R knitr package by Yihui Xie.

This is a very simple table generator. It is simple by design. It is not intended to replace any other R packages for making tables.

Related tags:

795 questions
5
votes
2 answers

Blogdown kable tables formatting (ugly)

kable(head(mtcars) %>% kable_styling(bootstrap_options = c("striped", "hover")) A normal R Markdown document, utilizing a kable table (see above), is quite striking and looks like this: However, when I use the same code chunk in blogdown, the…
Display name
  • 4,153
  • 5
  • 27
  • 75
5
votes
2 answers

wrapping wide table in rmarkdown

I have a really wide table (300+ columns) and would like to display it by wrapping the columns. In the example I will just use 100 columns. What I have in mind is repetitively using kable to display the subset of the…
Rachel Zhang
  • 562
  • 6
  • 20
5
votes
1 answer

Change font of Kable in Rmarkdown pdf

Is there a way to change the font of a kable in Rmarkdown when knitting to pdf? I can find plenty on changing size or bold etc but not on changing the actual font. I would just like something sans serif. Example markdown doc: --- title: "R…
Tadro
  • 61
  • 1
  • 3
5
votes
1 answer

How to adjust table to a pdf page with kable?

I am currently working on a Markdown file (with latex) where I use kable() and kableExtra for my tables. The problem is that some of my tables are to big and doesn't fit on a pdf page (even in landscape). I have tried to use latex_options =…
Gainz
  • 1,721
  • 9
  • 24
5
votes
3 answers

Error: Missing $ inserted when using kable

I am attempting to output a latex table using r markdown, kable, and kableExtra. I needed to use conditional logic to add colors to my table with cell_spec. But with the pdf output, it shows latex code as follows; pdf output with latex code If I add…
Vish
  • 53
  • 3
5
votes
2 answers

Change background colour of knitr::kable headers

I need to change the background colour of the headers of a table printed with knitr::kable. I can use kableExtra::column_spec to change the background of a whole column, but it doesn't affect the header…
InspectorSands
  • 2,859
  • 1
  • 18
  • 33
5
votes
1 answer

How can I generate a paged table with a title in RMarkdown?

I have a data.frame that I want to print in an RMarkdown document (HTML output) in a formatted way. There are 3 features I need for it which I haven't been able to get at the same time: It needs to have a title or caption at the top to explain what…
divibisan
  • 11,659
  • 11
  • 40
  • 58
5
votes
1 answer

kable/kableExtra Add superscript to group labels in group_rows

I have a table that I am creating for a pdf presentation using kable and kableExtra. I am wanting to group the rows and I need to use superscripts in the row group labels. I have tried several different things. Here is an example of some of the…
jamesguy0121
  • 1,124
  • 11
  • 28
5
votes
1 answer

Rmarkdown file knits to PDF successfully, but error when called from R

I have written an Rmarkdown file that loads some data and generates a cool kableExtra table with some symbols and custom colors and lines, printing it to pdf. It works great when I open the Rmarkdown file and knit, and produces the exact output that…
bogenton
  • 319
  • 3
  • 12
5
votes
0 answers

How to view rendered kable in R Notebooks inline output?

I don't think I understand how table rendering works inline in R Notebooks, and how kable output is formatted inline as well. I'd just like to be able to see dataframes in my notebook's inline output the way they appear when previewing the notebook…
Carmen Sandoval
  • 2,266
  • 5
  • 30
  • 46
5
votes
2 answers

Wrapping footnote to second line to fit table in kable (LaTeX .Rmd)

I'm wondering if there is a way I can force a footnote to fit the width of a table (and wrap to a second line) using kable in R (I'm knitting .Rmd to PDF so the format is latex). I've used both add_footnote() and footnote(). The add_footnote…
c.custer
  • 407
  • 5
  • 13
5
votes
3 answers

Inserting new lines into kable headers

Problem description: I'm writing a document in rMarkdown and I need to format a table before producing a PDF. The issue is that I'm having trouble inserting a new line in my kable headers that have been added using the add_headers_above…
Dom
  • 1,043
  • 2
  • 10
  • 20
5
votes
1 answer

Rendering Table with conditional color in latex as a pdf document with rownames = TRUE (rmarkdown, kable and kableExtra )

I am attempting to output a latex table using r markdown, kable and kableExtra. When i use the option row.names=FALSE instead of row.names=TRUE the latex code generates \vphantom code which produce an error to create the pdf . It seems the problem…
5
votes
1 answer

R markdown ioslides - change kable font size with CSS

I'm trying to fit a large table on one slide. I'm using kable. I tried {.smaller} but it's not quite enough so I thought I'd use a .css but it isn't working either. I created a sample presentation to illustrate the problem. I tried knitting it and…
rhedak
  • 53
  • 4
5
votes
1 answer

Dollar sign causes error in colored rows

I have a table that I'm trying to put into a pdf with R Markdown. dt <- c(name = c("a", "b", "c"), money = c("$1", "$10", "$100") dt %>% kable(format = "latex") %>% row_spec(1, background = "blue") The above code does not work, producing…
C.garner
  • 53
  • 4