0

I tried to change the color of my vline's in a table. I just swapped between \arrayrulecolor{white} and \arrayrulecolor{black}. Is it possible to only change the color for e.g. the vlines's so the hline's are not affected of my setting?

\begin{table}[h]
    \centering
    \setlength\arrayrulewidth{1pt}
    %\rowcolors{1}{TUMGray3}{}
    \footnotesize
    \arrayrulecolor{white}
    \begin{tabularx}{\textwidth}{c|C{2.45cm}|C{2.3cm}|C{2.1cm}|C{2.15cm}|c}
        \arrayrulecolor{black}
        \hline
        \TabHead Schriftgröße h &\TabHead Höhe der Kleinbuchstaben &\TabHead Abstand zwischen Zeichen &\TabHead Abstand zwischen Zeilen &\TabHead Abstand zwischen Wörtern &\TabHead Linienbreite d \\
        \hline %\TabHead formatiert die Überschriften der ersten Zeile
         \textbf{3,5} & 2,5  & 0,7 & 5 & 2,1 & \textbf{0,35}  \\ %\hline
         \textbf{5} & 3,5  & 1 & 7 & 3 & \textbf{0,5}  \\ \hline
    \end{tabularx}
    \caption{Schriftgrößen}
    \label{tab:schriftgroessen}
\end{table}
1

All you need is the code

!{\color{green}\vrule}

where you want colored verticals to appear

enter image description here

    \begin{tabularx}{\textwidth}{lX!{\color{green}\vrule}X!{\color{red}\vrule}X!{\color{blue}\vrule}X!{\color{black}\vrule}X}

\hline 
Schriftgröße h & Höhe der Kleinbuchstaben & Abstand zwischen Zeichen & Abstand zwischen Zeilen & Abstand zwischen Wörtern & Linienbreite d \\ 
\hline 
    \end{tabularx}

Another example of the same type

enter image description here

\documentclass{article}
\usepackage{colortbl}
\usepackage{tabularx}
\begin{document}
    \begin{tabular}{l!{\color{green}\vrule}l}
        \arrayrulecolor{red}\hline
        test & test\\\arrayrulecolor{blue}\hline
    \end{tabular}
\end{document}
0

Thanks a lot @js bibra. This fixed my problem. May I ask you another question regarding the same issue? Is it also possible, to only have the colored vertical lines in my tablhead?

\begin{table}[h]
    \centering
    \setlength\arrayrulewidth{1pt}
    \footnotesize
    \begin{tabularx}{\textwidth}{X!{\color{white}\vrule}C{2.2cm}!{\color{white}\vrule}C{2.3cm}!{\color{white}\vrule}C{3cm}!{\color{white}\vrule}L{3.6cm}}
        \hline
        \TabHead Blattgrößen\newline Reihe A &\TabHead Beschnittene Zeichnung &\TabHead Zeichenfläche &\TabHead Unbeschnittenes Blatt &\TabHead Günstige Rollenbreite\\
        \TabHead & \TabHead Breite \hfill Höhe & \TabHead Breite \hfill Höhe & \TabHead Breite \hfill Höhe & \TabHead  \\
        \hline %\TabHead formatiert die Überschriften der ersten Zeile
        A0 & 1189 \hfill 841 & 1159 \hfill 821 & 1230 \hfill 880 & 900 \hfill  \\ %\hline
        A1 & 841 \hfill 594 & 811 \hfill 574 & 880 \hfill 625 & 900 \hfill 660 \\ %\hline
        A2 & 594 \hfill 420 & 564 \hfill 400 & 625 \hfill 450 & 900 \hfill 660 \\ %\hline
        A3 & 420 \hfill 297 & 390 \hfill 277 & 450 \hfill 330 & 900 \hfill 660 \\ %\hline
        A4 & 210 \hfill 297 & 180 \hfill 277 & 240 \hfill 330 & 660 \hfill \\ \hline
    \end{tabularx}
    \label{tab:papierformate}
\end{table}

myexample

Thank u so much for help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.