I cannot figure out how to modify the Code given in this post in order to create an horizontal line over the last entry of the last column. That means I want the table to look like this (please excuse my bad drawing ;)):
Thank you
I cannot figure out how to modify the Code given in this post in order to create an horizontal line over the last entry of the last column. That means I want the table to look like this (please excuse my bad drawing ;)):
Thank you
You could do something like
late after line=\ifnumequal{\thecsvrow}{3}{\\\midrule}{\\},
too add a rule at a certain line.
The full source code is:
\documentclass{article}
\usepackage{csvsimple,booktabs}
% csv file
\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}
\csvreader[
tabular=ccccc,
table head=\toprule name & givenname & matriculation & gender & grade\\\midrule,
late after line=\ifnumequal{\thecsvrow}{3}{\\\midrule}{\\},
late after last line=\\,
table foot=\bottomrule,
head to column names,
]
{grade.csv}{}
{\name & \givenname & \matriculation & \gender & \grade}
\end{document}
Update:
To use a dashed line, the arydshln
package may be used which provides \hdashline
. I have no experience with that package, but the following seems to work:
\documentclass{article}
\usepackage{csvsimple,booktabs,arydshln}
% csv file
\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}
\csvreader[
tabular=ccccc,
table head=\toprule name & givenname & matriculation & gender & grade\\\midrule,
late after line=\ifnumequal{\thecsvrow}{3}{\\\hdashline}{\\},
late after last line=\\,
table foot=\bottomrule,
head to column names,
]
{grade.csv}{}
{\name & \givenname & \matriculation & \gender & \grade}
\end{document}