I'm using csvsimple for making tables, and csvautotabular and csvautobooktabular are working great. However, I'd like the content of each column to be centered instead of aligned to the left.
An answer using csvautotabular and/or csvautobooktabular simply adding an option would be preferred, if it's possible.
I tried this, but it returns an error.
\csvautotabular[tabular=c]{grade.csv}
\csvautobooktabular[tabular=c]{grade.csv}
Here's a MWE:
\documentclass[11pt,a4paper,oldfontcommands]{memoir}
\usepackage{csvsimple} % For csv importing.
% csv file from another question
\begin{filecontents*}{grade.csv}
name,givenname,matriculation,gender,grade
Maier,Hans,12345,m,1.0
Huber,Anna,23456,f,2.3
Weisbaeck,Werner,34567,m,5.0
\end{filecontents*}
\begin{document}
\csvautotabular{grade.csv}
\end{document}
And the MWE output.
I want to obtain said output, but with the content of each column centered.
Note
csvautotabular gave me trouble trying to display special characters, but can be solved using the 'respect all' option.
e.g.
\csvautotabular[respect all]{table.csv}
Or with @egreg's custom command.
\csvautotabularcenter[respect all]{table.csv}