I am using the package longtable and what I want to achieve is to have vertically centered cells, and equal row height.
I have tried using m{} column type, to achieve the vertical centering, but when I try to increase row height using arraystretch, the vertical alignmnent fails. So I need help in two matters
- Why does arraystretch mess with the vertical alignment? How else could the functionality of arraystretch be achieved and keep the alignment?
- Arraystretch does not give me equal row height but it only increases padding. How can I have equal row height?
Here is the output, you can see the difference in the arrow lengths:
MWE:
\documentclass{article}
\usepackage[table,dvipsnames]{xcolor}%table colors
\usepackage{array}
\usepackage{makecell}
\usepackage{longtable}
\setlength{\doublerulesep}{0pt}
\newcommand{\myhline}{\hline\hline\hline}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}m{#1}}
\begin{document}
\begin{footnotesize}
\renewcommand{\arraystretch}{3}
\rowcolors{2}{MidnightBlue!10}{white}
\begin{longtable}{ | C{1.7in} | C{1.5in} | C{0.65in} | C{0.6in} | C{0.6in} | }
\hline
\rowcolor{MidnightBlue!30}
\textbf{test1} & \textbf{test2} & \textbf{test3} & \textbf{test4} & \textbf{test5} \
\myhline
\textbf{qwerty} & testing simple & - & + & + \
\textbf{qwerty2} & testing simple long test & - & + & -\
\textbf{qwerty} & testing simple long test & - & + & + \
\textbf{qwerty} & testing simple long test & - & + & + \
\textbf{qwerty} & testing simple long test & - &+ & + \
\textbf{qwerty} & testing reaaaaaaaaaaaally simple loooooooooooooong test & - & + & + \
\textbf{qwerty} & testing simple long test & - & + & + \
\textbf{qwerty} & testing simple long test (pixels) & - & + & + \
\textbf{qwerty} & testing simple long test & - & + & + \
\hline
\rowcolor{white}
\caption{Table testing}
\label{my_label}
\end{longtable}
\end{footnotesize}
\end{document}


longtableor a different package, that can break tables across pages mandatory? – leandriis May 27 '21 at 17:53