I am using the function kable()
of the knitr package to create a table of good quality books in a pdf document. The output looks like the one below, where the table is on the left.

I want to place the table in the center as shown below.

I would be grateful if anyone could give some advice. I know I can do this using xtable
. Is there a way to do this directly with kable?
The complete reproducible knitr code (.Rnw file) is as follows:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
<<results='asis'>>=
library(knitr)
kable(head(women), format='latex', booktabs=TRUE)
@
\end{document}
source
share