How to add a grid to a table with pander?

I work with R, knitr and pander, and I cannot find an option that would allow me to print the grid on the table with pander. I tried:

pander(tableToPrint, style='grid') 

but it does nothing, neither with this option, nor with "multi-line", "rmarkdown" ... I always get a horizontal line, then column names, another horizontal line, all my data and a horizontal line, I would like to have a horizontal line between each line. Another option is to alternate the colors of the lines.

+4
source share
1 answer

, , pandoc. :

\catcode`@=11
\let \savecr \@tabularcr
\def\@tabularcr{\savecr\hline}
\catcode`@=12

, - , , , . , pandoc -D latex > template.tex ( ) \documentclass. :

---
title: "Untitled"
output:
  pdf_document:
    keep_tex: yes
    template: "template.tex"
---

. , .

docx. Pandoc docx .

html :

---
title: "Untitled"
output: html_document
---
<style>
th, td {
    border-bottom: 2px solid black;
}
</style>
+6

Source: https://habr.com/ru/post/1624774/


All Articles