1

I'm making a large table using solution from Rotated column titles in tabular user Martin Scharrer.

However, this solution seems to prevent any right-hand vertical line from showing up in the header.

For example, a slight modification of his solution to illustrate the problem:

\documentclass{article}
%https://texblog.org/2012/05/30/generate-latex-tables-from-csv-files-excel/
\usepackage{adjustbox}
\usepackage{array}

\newcolumntype{R}[2]{%
    >{\adjustbox{angle=#1,lap=\width-(#2)}\bgroup}%
    l%
    <{\egroup}%
}
\newcommand*\rot{\multicolumn{1}{R{45}{1em}}}% no optional argument here, please!

\begin{document}

\begin{tabular}{r|ccc|} % the header ignores the right-most "|"
&
\rot{Property 1} &
\rot{Property 2} &
\rot{Property 3}
    \\ \hline
System 1        &       &       &  X    \\ 
System 2        & X     & X     &  X    \\
System 3        & X &   &  X    \\ \hline
\end{tabular}
\end{document}

the problematic part is that \begin{tabular}{r|ccc|} ignores the header ignores the right-most |. However, the vertical lines does show on succeeding rows.

How can I get this right-most vertical line to show in the header?

con
  • 351
  • 1
  • 3
  • 15
  • 1
    It is not possible, since it will cut column header. So it is deliberately eliminated ... try your MWE with \newcommand*\rot{\multicolumn{1}{R{45}{1em}|}} and you will see why. I would remove all vertical lines and instead of \hline use rules determined by booktabs package. – Zarko Feb 21 '20 at 17:20

0 Answers0