Reputation: 1817
I am using the pander::pander
function to make some tables in a knitted latex document. I want the rows to be left justified and the column names to be centered.
library(pander)
library(dplyr)
tibble(`column name` = c("long text string", "* hi")) %>%
pander(
keep.line.breaks = TRUE,
style = 'grid',
missing = '',
split.table = Inf,
justify = 'left'
)
Does the pander
function have an argument to center column names? I am having trouble finding it in the documentation or anywhere else online.
Upvotes: 1
Views: 215
Reputation: 389325
You can try using pandoc.table
:
tibble(`column name` = "long text string") %>%
pandoc.table()
#------------------
# column name
#------------------
# long text string
#------------------
Upvotes: 1