4

Sorry if this is a very trivial question but I've looked up and down the internet and can't find an answer. I'm making a basic table using the gt package in markdown. But I can't seem to get the text to wrap when knitting to a *.pdf. Any help would be greatly appreciated!

table_data %>% gt()
shafee
  • 15,566
  • 3
  • 19
  • 47
randmlaber
  • 109
  • 1
  • 1
  • 6

1 Answers1

3

Not an answer, but a reproducible working example.

---
title: "Test"
output: pdf_document
---

```{r test, echo=FALSE, warning = FALSE}
library(tidyverse)
library(gt)

test <- data.frame(v1=c(
  "This is a long string. This is a long string. This is a long string. This is a long string. This is a long string.",
  "This is a another long string. This is a another long string. This is a another long string. This is a another long string. This is a another long string."),
                   v2=c(1, 2))
test %>% gt()
```

results in:

enter image description here

Mar
  • 112
  • 1
  • 13