kable, collapse_rows and booktabs: no alignement to the top
Asked Answered
B

0

2

I am trying to print a data.frame in a pdf using kable and collapse_rows functions. And it did not manage to make it works. Please try the following reprex:

---
title: "Example"
output:
  bookdown::pdf_document2
---

```{r bandIdentif, echo=F}

 library(dplyr);library(kableExtra)

 dt <- data.frame(A = c(rep("a", 2), rep("b", 3)),
                  B = c(paste("answer", 1:5)))

 kable(dt, "latex") %>%
   collapse_rows(columns = 1, valign = "top")

```

I have updated all the packages (MaxTex and R) and Rstudio. However, the pdf output exhibit a strange behavior of vertical alignment:

test

I looked during hours on the web but i cannot manage to find a solution. Please help :)

Birdsong answered 17/6, 2020 at 0:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.